1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
# name: test/sql/function/time/test_extract_stats.test
# description: Extract function statistics
# group: [time]
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE times(i TIME)
statement ok
INSERT INTO times VALUES ('00:01:20'), ('20:08:10.998'), ('20:08:10.33'), ('20:08:10.001'), (NULL)
statement ok
PRAGMA disable_verification
# extract various parts of the time
query I
SELECT stats(EXTRACT(second FROM i)) FROM times LIMIT 1
----
<REGEX>:.*0.*60.*true.*
query I
SELECT stats(EXTRACT(minute FROM i)) FROM times LIMIT 1
----
<REGEX>:.*0.*60.*true.*
query I
SELECT stats(EXTRACT(hour FROM i)) FROM times LIMIT 1
----
<REGEX>:.*0.*24.*true.*
query I
SELECT stats(EXTRACT(milliseconds FROM i)) FROM times LIMIT 1
----
<REGEX>:.*0.*60000.*true.*
query I
SELECT stats(EXTRACT(microseconds FROM i)) FROM times LIMIT 1
----
<REGEX>:.*0.*60000000.*true.*
query I
SELECT stats(EXTRACT(epoch FROM i)) FROM times LIMIT 1
----
<REGEX>:.*0.*86400.*true.*
|