-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQL tests for dimension-only sub-daily queries
- Loading branch information
1 parent
b11c539
commit b649bf1
Showing
4 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...nularity_date_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
-- Pass Only Elements: ['metric_time__millisecond',] | ||
SELECT | ||
subq_1.metric_time__millisecond | ||
FROM ( | ||
-- Metric Time Dimension 'ts' | ||
SELECT | ||
subq_0.ts__millisecond | ||
, subq_0.ts__second | ||
, subq_0.ts__minute | ||
, subq_0.ts__hour | ||
, subq_0.ts__day | ||
, subq_0.ts__week | ||
, subq_0.ts__month | ||
, subq_0.ts__quarter | ||
, subq_0.ts__year | ||
, subq_0.ts__extract_year | ||
, subq_0.ts__extract_quarter | ||
, subq_0.ts__extract_month | ||
, subq_0.ts__extract_day | ||
, subq_0.ts__extract_dow | ||
, subq_0.ts__extract_doy | ||
, subq_0.ts__millisecond AS metric_time__millisecond | ||
, subq_0.ts__second AS metric_time__second | ||
, subq_0.ts__minute AS metric_time__minute | ||
, subq_0.ts__hour AS metric_time__hour | ||
, subq_0.ts__day AS metric_time__day | ||
, subq_0.ts__week AS metric_time__week | ||
, subq_0.ts__month AS metric_time__month | ||
, subq_0.ts__quarter AS metric_time__quarter | ||
, subq_0.ts__year AS metric_time__year | ||
, subq_0.ts__extract_year AS metric_time__extract_year | ||
, subq_0.ts__extract_quarter AS metric_time__extract_quarter | ||
, subq_0.ts__extract_month AS metric_time__extract_month | ||
, subq_0.ts__extract_day AS metric_time__extract_day | ||
, subq_0.ts__extract_dow AS metric_time__extract_dow | ||
, subq_0.ts__extract_doy AS metric_time__extract_doy | ||
FROM ( | ||
-- Time Spine | ||
SELECT | ||
DATE_TRUNC('millisecond', time_spine_src_28002.ts) AS ts__millisecond | ||
, DATE_TRUNC('second', time_spine_src_28002.ts) AS ts__second | ||
, DATE_TRUNC('minute', time_spine_src_28002.ts) AS ts__minute | ||
, DATE_TRUNC('hour', time_spine_src_28002.ts) AS ts__hour | ||
, DATE_TRUNC('day', time_spine_src_28002.ts) AS ts__day | ||
, DATE_TRUNC('week', time_spine_src_28002.ts) AS ts__week | ||
, DATE_TRUNC('month', time_spine_src_28002.ts) AS ts__month | ||
, DATE_TRUNC('quarter', time_spine_src_28002.ts) AS ts__quarter | ||
, DATE_TRUNC('year', time_spine_src_28002.ts) AS ts__year | ||
, EXTRACT(year FROM time_spine_src_28002.ts) AS ts__extract_year | ||
, EXTRACT(quarter FROM time_spine_src_28002.ts) AS ts__extract_quarter | ||
, EXTRACT(month FROM time_spine_src_28002.ts) AS ts__extract_month | ||
, EXTRACT(day FROM time_spine_src_28002.ts) AS ts__extract_day | ||
, EXTRACT(isodow FROM time_spine_src_28002.ts) AS ts__extract_dow | ||
, EXTRACT(doy FROM time_spine_src_28002.ts) AS ts__extract_doy | ||
FROM ***************************.mf_time_spine_millisecond time_spine_src_28002 | ||
) subq_0 | ||
) subq_1 | ||
GROUP BY | ||
subq_1.metric_time__millisecond |
8 changes: 8 additions & 0 deletions
8
...ate_part_rendering.py/SqlQueryPlan/DuckDB/test_sub_daily_metric_time__plan0_optimized.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- Time Spine | ||
-- Metric Time Dimension 'ts' | ||
-- Pass Only Elements: ['metric_time__millisecond',] | ||
SELECT | ||
DATE_TRUNC('millisecond', ts) AS metric_time__millisecond | ||
FROM ***************************.mf_time_spine_millisecond time_spine_src_28002 | ||
GROUP BY | ||
DATE_TRUNC('millisecond', ts) |