ClickHouse/tests/performance/date_time_short.xml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
2.7 KiB
XML
Raw Permalink Normal View History

2023-01-13 14:01:13 +00:00
<!--
This is a performance smoke test for DateTime and Date. Some other basic functions are tested by date_time_64.xml, and a more
exhaustive list of functions is in date_time_long.xml (it's about an hour so we can't afford to test it on each commit).
-->
2020-06-29 07:58:50 +00:00
<test>
<substitutions>
<substitution>
<name>date_transform</name>
<values>
<value>toMonday</value>
<value>toRelativeDayNum</value>
<value>toYYYYMMDDhhmmss</value>
</values>
</substitution>
<substitution>
<name>time_zone</name>
<values>
2022-03-11 22:49:13 +00:00
<value>Asia/Istanbul</value>
2020-06-29 07:58:50 +00:00
</values>
</substitution>
<substitution>
<name>binary_function</name>
<values>
<value>lessOrEquals</value>
<value>greater</value>
<value>plus</value>
<value>addWeeks</value>
</values>
</substitution>
</substitutions>
2023-01-13 14:01:13 +00:00
<!-- {date_transform} -->
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, {date_transform}(t, '{time_zone}'))</query>
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDate('2017-01-01') + number % 1000 + rand() % 10 AS t, {date_transform}(t))</query>
<!-- toUnixTimestamp() -->
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, toUnixTimestamp(t, '{time_zone}'))</query>
2023-01-13 14:01:13 +00:00
<!-- toUnixTimestamp(Date()) is prohibited, wrap Date() with toUInt16() to overcome -->
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDate('2017-01-01') + number % 1000 + rand() % 10 AS t, toUnixTimestamp(toUInt16(t)))</query>
2023-01-13 14:01:13 +00:00
<!-- {binary_function} -->
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, {binary_function}(t, 1))</query>
2023-01-13 14:01:13 +00:00
<!-- misc -->
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, toStartOfInterval(t, INTERVAL 1 month))</query>
2023-01-13 14:01:13 +00:00
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, date_trunc('month', t))</query>
2023-01-13 14:01:13 +00:00
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDateTime('2017-01-01 00:00:00') + number % 100000000 + rand() % 100000 AS t, toDayOfWeek(t, 0, '{time_zone}'))</query>
<query>SELECT count() FROM numbers(50000000) WHERE NOT ignore(toDate('2017-01-01') + number % 1000 + rand() % 10 AS t, toDayOfWeek(t))</query>
2020-06-29 07:58:50 +00:00
</test>