mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 11:32:03 +00:00
Integrate test 02763_last_day_of_week into existing test 00941_to_custom_week
This commit is contained in:
parent
9a8086a377
commit
a23af1b065
@ -71,3 +71,13 @@
|
||||
2019-01-01 2019-01-01 00:00:00 2018-12-30 2018-12-30 2018-12-31 2018-12-31
|
||||
2019-01-02 2019-01-02 00:00:00 2018-12-30 2018-12-30 2018-12-31 2018-12-31
|
||||
2019-01-03 2019-01-03 00:00:00 2018-12-30 2018-12-30 2018-12-31 2018-12-31
|
||||
2018-12-25 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-26 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-27 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-28 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-29 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-30 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-31 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2019-01-06 2019-01-06 2019-01-06 2019-01-06
|
||||
2019-01-01 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2019-01-06 2019-01-06 2019-01-06 2019-01-06
|
||||
2019-01-02 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2019-01-06 2019-01-06 2019-01-06 2019-01-06
|
||||
2019-01-03 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2019-01-06 2019-01-06 2019-01-06 2019-01-06
|
||||
|
@ -50,3 +50,21 @@ SELECT
|
||||
toStartOfWeek(x_t, 3) AS wt3
|
||||
FROM numbers(10);
|
||||
|
||||
-- toLastDayOfWeek
|
||||
WITH
|
||||
toDate('2018-12-25') + number AS d,
|
||||
toDate32(d) AS d32,
|
||||
toDateTime(d) AS dt,
|
||||
toDateTime64(d, 0) AS dt64
|
||||
SELECT
|
||||
dt64,
|
||||
toLastDayOfWeek(d) AS wd_sun,
|
||||
toLastDayOfWeek(d32) AS wd32_sun,
|
||||
toLastDayOfWeek(dt) AS wdt_sun,
|
||||
toLastDayOfWeek(dt64) AS wdt64_sun,
|
||||
toLastDayOfWeek(d, 1) AS wd_mon,
|
||||
toLastDayOfWeek(d32, 1) AS wd32_mon,
|
||||
toLastDayOfWeek(dt, 1) AS wdt_mon,
|
||||
toLastDayOfWeek(dt64, 1) AS wdt64_mon
|
||||
FROM numbers(10);
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
2018-12-25 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-26 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-27 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-28 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-29 00:00:00 2018-12-29 2018-12-29 2018-12-29 2018-12-29 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-30 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2018-12-30 2018-12-30 2018-12-30 2018-12-30
|
||||
2018-12-31 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2019-01-06 2019-01-06 2019-01-06 2019-01-06
|
||||
2019-01-01 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2019-01-06 2019-01-06 2019-01-06 2019-01-06
|
||||
2019-01-02 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2019-01-06 2019-01-06 2019-01-06 2019-01-06
|
||||
2019-01-03 00:00:00 2019-01-05 2019-01-05 2019-01-05 2019-01-05 2019-01-06 2019-01-06 2019-01-06 2019-01-06
|
@ -1,17 +0,0 @@
|
||||
WITH
|
||||
toDate('2018-12-25') + number AS d,
|
||||
toDate32(d) AS d32,
|
||||
toDateTime(d) AS dt,
|
||||
toDateTime64(d, 0) AS dt64
|
||||
SELECT
|
||||
dt64,
|
||||
toLastDayOfWeek(d) AS wd_0,
|
||||
toLastDayOfWeek(d32) AS wd32_0,
|
||||
toLastDayOfWeek(dt) AS wdt_0,
|
||||
toLastDayOfWeek(dt64) AS wdt64_0,
|
||||
toLastDayOfWeek(d, 3) AS wd_3,
|
||||
toLastDayOfWeek(d32, 3) AS wd32_3,
|
||||
toLastDayOfWeek(dt, 3) AS wdt_3,
|
||||
toLastDayOfWeek(dt64, 3) AS wdt64_3
|
||||
FROM numbers(10);
|
||||
|
Loading…
Reference in New Issue
Block a user