Amend the tests

This commit is contained in:
Victor Krasnov 2023-06-08 17:25:53 +03:00
parent 0dd75d7648
commit 9f61c786ed
2 changed files with 34 additions and 84 deletions

View File

@ -1,20 +1,5 @@
parseDateTimeBestEffort
dt_ref res res_sam res_auc res_null res_null_sam res_null_auc res_zero res_zero_sam res_zero_auc
dt_ref res res_sam res_auc res_null res_null_sam res_null_auc res_zero res_zero_sam res_zero_auc res_us res_us_sam res_us_auc res_us_null res_us_null_sam res_us_null_auc res_us_zero res_us_zero_sam res_us_zero_auc res64 res64_sam res64_auc res64_null res64_null_sam res64_null_auc res64_zero res64_zero_sam res64_zero_auc res64_us res64_us_sam res64_us_auc res64_us_null res64_us_null_sam res64_us_null_auc res64_us_zero res64_us_zero_sam res64_us_zero_auc
Jun 7 04:55:00 2023-06-07 04:55:00 2022-06-07 04:55:00 2023-06-07 04:55:00 2023-06-07 04:55:00 2022-06-07 04:55:00 2023-06-07 04:55:00 2023-06-07 04:55:00 2022-06-07 04:55:00 2023-06-07 04:55:00
Jun 7 04:56:00 2022-06-07 04:56:00 2022-06-07 04:56:00 2023-06-07 04:56:00 2022-06-07 04:56:00 2022-06-07 04:56:00 2023-06-07 04:56:00 2022-06-07 04:56:00 2022-06-07 04:56:00 2023-06-07 04:56:00
parseDateTimeBestEffortUS
dt_ref res res_sam res_auc res_null res_null_sam res_null_auc res_zero res_zero_sam res_zero_auc
Jun 7 04:55:00 2023-06-07 04:55:00 2022-06-07 04:55:00 2023-06-07 04:55:00 2023-06-07 04:55:00 2022-06-07 04:55:00 2023-06-07 04:55:00 2023-06-07 04:55:00 2022-06-07 04:55:00 2023-06-07 04:55:00
Jun 7 04:56:00 2022-06-07 04:56:00 2022-06-07 04:56:00 2023-06-07 04:56:00 2022-06-07 04:56:00 2022-06-07 04:56:00 2023-06-07 04:56:00 2022-06-07 04:56:00 2022-06-07 04:56:00 2023-06-07 04:56:00
parseDateTime64BestEffort
dt_ref res res_sam res_auc res_null res_null_sam res_null_auc res_zero res_zero_sam res_zero_auc
Jun 7 04:55:00 2023-06-07 04:55:00.000 2022-06-07 04:55:00.000 2023-06-07 04:55:00.000 2023-06-07 04:55:00.000 2022-06-07 04:55:00.000 2023-06-07 04:55:00.000 2023-06-07 04:55:00.000 2022-06-07 04:55:00.000 2023-06-07 04:55:00.000
Jun 7 04:56:00 2022-06-07 04:56:00.000 2022-06-07 04:56:00.000 2023-06-07 04:56:00.000 2022-06-07 04:56:00.000 2022-06-07 04:56:00.000 2023-06-07 04:56:00.000 2022-06-07 04:56:00.000 2022-06-07 04:56:00.000 2023-06-07 04:56:00.000
parseDateTime64BestEffortUS
dt_ref res res_sam res_auc res_null res_null_sam res_null_auc res_zero res_zero_sam res_zero_auc
Jun 7 04:55:00 2023-06-07 04:55:00.000 2022-06-07 04:55:00.000 2023-06-07 04:55:00.000 2023-06-07 04:55:00.000 2022-06-07 04:55:00.000 2023-06-07 04:55:00.000 2023-06-07 04:55:00.000 2022-06-07 04:55:00.000 2023-06-07 04:55:00.000
Jun 7 04:56:00 2022-06-07 04:56:00.000 2022-06-07 04:56:00.000 2023-06-07 04:56:00.000 2022-06-07 04:56:00.000 2022-06-07 04:56:00.000 2023-06-07 04:56:00.000 2022-06-07 04:56:00.000 2022-06-07 04:56:00.000 2023-06-07 04:56:00.000
Jun 6 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000 2023-06-06 00:00:00.000
Jun 8 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000 2022-06-08 00:00:00.000

View File

@ -1,8 +1,9 @@
SELECT 'parseDateTimeBestEffort';
WITH
86400 AS secs_in_day,
now() AS ts_now,
'2023-06-07 04:55:30' AS ref_point,
'2023-06-07' AS ref_point,
dateDiff('second', toDateTime(ref_point), ts_now) AS impedimenta,
formatDateTime(ts_around, '%b %e %T') AS dt_curr
SELECT
@ -15,69 +16,33 @@ SELECT
parseDateTimeBestEffortOrNull(dt_curr, 'Pacific/Auckland') - impedimenta AS res_null_auc,
parseDateTimeBestEffortOrZero(dt_curr) - impedimenta AS res_zero,
parseDateTimeBestEffortOrZero(dt_curr, 'US/Samoa') - impedimenta AS res_zero_sam,
parseDateTimeBestEffortOrZero(dt_curr, 'Pacific/Auckland') - impedimenta AS res_zero_auc
FROM (SELECT arrayJoin([ts_now - 30, ts_now + 30]) AS ts_around)
FORMAT PrettySpaceNoEscapes;
SELECT 'parseDateTimeBestEffortUS';
WITH
now() AS ts_now,
'2023-06-07 04:55:30' AS ref_point,
dateDiff('second', toDateTime(ref_point), ts_now) AS impedimenta,
formatDateTime(ts_around, '%b %e %T') AS dt_curr
SELECT
formatDateTime(ts_around - impedimenta, '%b %e %H:%i:%s') AS dt_ref,
parseDateTimeBestEffortUS(dt_curr) - impedimenta AS res,
parseDateTimeBestEffortUS(dt_curr, 'US/Samoa') - impedimenta AS res_sam,
parseDateTimeBestEffortUS(dt_curr, 'Pacific/Auckland') - impedimenta AS res_auc,
parseDateTimeBestEffortUSOrNull(dt_curr) - impedimenta AS res_null,
parseDateTimeBestEffortUSOrNull(dt_curr, 'US/Samoa') - impedimenta AS res_null_sam,
parseDateTimeBestEffortUSOrNull(dt_curr, 'Pacific/Auckland') - impedimenta AS res_null_auc,
parseDateTimeBestEffortUSOrZero(dt_curr) - impedimenta AS res_zero,
parseDateTimeBestEffortUSOrZero(dt_curr, 'US/Samoa') - impedimenta AS res_zero_sam,
parseDateTimeBestEffortUSOrZero(dt_curr, 'Pacific/Auckland') - impedimenta AS res_zero_auc
FROM (SELECT arrayJoin([ts_now - 30, ts_now + 30]) AS ts_around)
FORMAT PrettySpaceNoEscapes;
SELECT 'parseDateTime64BestEffort';
WITH
now() AS ts_now,
'2023-06-07 04:55:30' AS ref_point,
dateDiff('second', toDateTime(ref_point), ts_now) AS impedimenta,
formatDateTime(ts_around, '%b %e %T') AS dt_curr
SELECT
formatDateTime(ts_around - impedimenta, '%b %e %H:%i:%s') AS dt_ref,
parseDateTime64BestEffort(dt_curr) - impedimenta AS res,
parseDateTime64BestEffort(dt_curr, 3, 'US/Samoa') - impedimenta AS res_sam,
parseDateTime64BestEffort(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res_auc,
parseDateTime64BestEffortOrNull(dt_curr) - impedimenta AS res_null,
parseDateTime64BestEffortOrNull(dt_curr, 3, 'US/Samoa') - impedimenta AS res_null_sam,
parseDateTime64BestEffortOrNull(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res_null_auc,
parseDateTime64BestEffortOrZero(dt_curr) - impedimenta AS res_zero,
parseDateTime64BestEffortOrZero(dt_curr, 3, 'US/Samoa') - impedimenta AS res_zero_sam,
parseDateTime64BestEffortOrZero(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res_zero_auc
FROM (SELECT arrayJoin([ts_now - 30, ts_now + 30]) AS ts_around)
FORMAT PrettySpaceNoEscapes;
SELECT 'parseDateTime64BestEffortUS';
WITH
now() AS ts_now,
'2023-06-07 04:55:30' AS ref_point,
dateDiff('second', toDateTime(ref_point), ts_now) AS impedimenta,
formatDateTime(ts_around, '%b %e %T') AS dt_curr
SELECT
formatDateTime(ts_around - impedimenta, '%b %e %H:%i:%s') AS dt_ref,
parseDateTime64BestEffortUS(dt_curr) - impedimenta AS res,
parseDateTime64BestEffortUS(dt_curr, 3, 'US/Samoa') - impedimenta AS res_sam,
parseDateTime64BestEffortUS(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res_auc,
parseDateTime64BestEffortUSOrNull(dt_curr) - impedimenta AS res_null,
parseDateTime64BestEffortUSOrNull(dt_curr, 3, 'US/Samoa') - impedimenta AS res_null_sam,
parseDateTime64BestEffortUSOrNull(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res_null_auc,
parseDateTime64BestEffortUSOrZero(dt_curr) - impedimenta AS res_zero,
parseDateTime64BestEffortUSOrZero(dt_curr, 3, 'US/Samoa') - impedimenta AS res_zero_sam,
parseDateTime64BestEffortUSOrZero(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res_zero_auc
FROM (SELECT arrayJoin([ts_now - 30, ts_now + 30]) AS ts_around)
parseDateTimeBestEffortOrZero(dt_curr, 'Pacific/Auckland') - impedimenta AS res_zero_auc,
parseDateTimeBestEffortUS(dt_curr) - impedimenta AS res_us,
parseDateTimeBestEffortUS(dt_curr, 'US/Samoa') - impedimenta AS res_us_sam,
parseDateTimeBestEffortUS(dt_curr, 'Pacific/Auckland') - impedimenta AS res_us_auc,
parseDateTimeBestEffortUSOrNull(dt_curr) - impedimenta AS res_us_null,
parseDateTimeBestEffortUSOrNull(dt_curr, 'US/Samoa') - impedimenta AS res_us_null_sam,
parseDateTimeBestEffortUSOrNull(dt_curr, 'Pacific/Auckland') - impedimenta AS res_us_null_auc,
parseDateTimeBestEffortUSOrZero(dt_curr) - impedimenta AS res_us_zero,
parseDateTimeBestEffortUSOrZero(dt_curr, 'US/Samoa') - impedimenta AS res_us_zero_sam,
parseDateTimeBestEffortUSOrZero(dt_curr, 'Pacific/Auckland') - impedimenta AS res_us_zero_auc,
parseDateTime64BestEffort(dt_curr) - impedimenta AS res64,
parseDateTime64BestEffort(dt_curr, 3, 'US/Samoa') - impedimenta AS res64_sam,
parseDateTime64BestEffort(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res64_auc,
parseDateTime64BestEffortOrNull(dt_curr) - impedimenta AS res64_null,
parseDateTime64BestEffortOrNull(dt_curr, 3, 'US/Samoa') - impedimenta AS res64_null_sam,
parseDateTime64BestEffortOrNull(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res64_null_auc,
parseDateTime64BestEffortOrZero(dt_curr) - impedimenta AS res64_zero,
parseDateTime64BestEffortOrZero(dt_curr, 3, 'US/Samoa') - impedimenta AS res64_zero_sam,
parseDateTime64BestEffortOrZero(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res64_zero_auc,
parseDateTime64BestEffortUS(dt_curr) - impedimenta AS res64_us,
parseDateTime64BestEffortUS(dt_curr, 3, 'US/Samoa') - impedimenta AS res64_us_sam,
parseDateTime64BestEffortUS(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res64_us_auc,
parseDateTime64BestEffortUSOrNull(dt_curr) - impedimenta AS res64_us_null,
parseDateTime64BestEffortUSOrNull(dt_curr, 3, 'US/Samoa') - impedimenta AS res64_us_null_sam,
parseDateTime64BestEffortUSOrNull(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res64_us_null_auc,
parseDateTime64BestEffortUSOrZero(dt_curr) - impedimenta AS res64_us_zero,
parseDateTime64BestEffortUSOrZero(dt_curr, 3, 'US/Samoa') - impedimenta AS res64_us_zero_sam,
parseDateTime64BestEffortUSOrZero(dt_curr, 3, 'Pacific/Auckland') - impedimenta AS res64_us_zero_auc
FROM (SELECT arrayJoin([ts_now - secs_in_day, ts_now + secs_in_day]) AS ts_around)
FORMAT PrettySpaceNoEscapes;