-
Notifications
You must be signed in to change notification settings - Fork 28k
/
interval.sql.out
114 lines (86 loc) · 2.7 KB
/
interval.sql.out
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 14
-- !query 0
set spark.sql.IntervalOutputStyle=SQL_STANDARD
-- !query 0 schema
struct<key:string,value:string>
-- !query 0 output
spark.sql.IntervalOutputStyle SQL_STANDARD
-- !query 1
select interval 4 month 2 weeks 3 microseconds
-- !query 1 schema
struct<4 months 14 days 0.000003 seconds:interval>
-- !query 1 output
0-4 14 0:00:00.000003
-- !query 2
select interval '1 year 20 month'
-- !query 2 schema
struct<2 years 8 months:interval>
-- !query 2 output
2-8
-- !query 3
select interval '-1 year -20 month'
-- !query 3 schema
struct<-2 years -8 months:interval>
-- !query 3 output
-2-8
-- !query 4
select interval '20 month 30 days -21 hours 10 minutes 999 milliseconds'
-- !query 4 schema
struct<1 years 8 months 30 days -20 hours -49 minutes -59.001 seconds:interval>
-- !query 4 output
1-8 30 -20:49:59.001
-- !query 5
select date'2019-10-15' - timestamp'2019-10-15 10:11:12.001002'
-- !query 5 schema
struct<subtracttimestamps(CAST(DATE '2019-10-15' AS TIMESTAMP), TIMESTAMP('2019-10-15 10:11:12.001002')):interval>
-- !query 5 output
-10:11:12.001002
-- !query 6
set spark.sql.IntervalOutputStyle=MULTI_UNITS
-- !query 6 schema
struct<key:string,value:string>
-- !query 6 output
spark.sql.IntervalOutputStyle MULTI_UNITS
-- !query 7
select 3 * (timestamp'2019-10-15 10:11:12.001002' - date'2019-10-15')
-- !query 7 schema
struct<multiply_interval(subtracttimestamps(TIMESTAMP('2019-10-15 10:11:12.001002'), CAST(DATE '2019-10-15' AS TIMESTAMP)), CAST(3 AS DOUBLE)):interval>
-- !query 7 output
30 hours 33 minutes 36.003006 seconds
-- !query 8
select interval 4 month 2 weeks 3 microseconds * 1.5
-- !query 8 schema
struct<multiply_interval(4 months 14 days 0.000003 seconds, CAST(1.5 AS DOUBLE)):interval>
-- !query 8 output
6 months 21 days 0.000005 seconds
-- !query 9
select (timestamp'2019-10-15' - timestamp'2019-10-14') / 1.5
-- !query 9 schema
struct<divide_interval(subtracttimestamps(TIMESTAMP('2019-10-15 00:00:00'), TIMESTAMP('2019-10-14 00:00:00')), CAST(1.5 AS DOUBLE)):interval>
-- !query 9 output
16 hours
-- !query 10
select interval '2 seconds' / 0
-- !query 10 schema
struct<divide_interval(2 seconds, CAST(0 AS DOUBLE)):interval>
-- !query 10 output
NULL
-- !query 11
select interval '2 seconds' / null
-- !query 11 schema
struct<divide_interval(2 seconds, CAST(NULL AS DOUBLE)):interval>
-- !query 11 output
NULL
-- !query 12
select interval '2 seconds' * null
-- !query 12 schema
struct<multiply_interval(2 seconds, CAST(NULL AS DOUBLE)):interval>
-- !query 12 output
NULL
-- !query 13
select null * interval '2 seconds'
-- !query 13 schema
struct<multiply_interval(2 seconds, CAST(NULL AS DOUBLE)):interval>
-- !query 13 output
NULL