3
3
4
4
5
5
-- !query
6
- create temporary view v as select t from values
6
+ create temporary view v as select col from values
7
7
(timestamp '1582-06-01 11:33:33.123UTC+080000'),
8
8
(timestamp '1970-01-01 00:00:00.000Europe/Paris'),
9
9
(timestamp '1970-12-31 23:59:59.999Asia/Srednekolymsk'),
@@ -14,53 +14,77 @@ create temporary view v as select t from values
14
14
-- !query schema
15
15
struct<>
16
16
-- !query output
17
- org.apache.spark.sql.AnalysisException
18
- cannot resolve '`t`' given input columns: [t.col]; line 1 pos 34
17
+
19
18
20
19
21
20
-- !query
22
21
select col, date_format(col, 'Y-w-u YYYY-ww-uu YYY-W-uuu YY YYYYY uuuu E EE EEE EEEE') from v
23
22
-- !query schema
24
- struct<>
23
+ struct<col:timestamp,date_format(col, Y-w-u YYYY-ww-uu YYY-W-uuu YY YYYYY uuuu E EE EEE EEEE):string >
25
24
-- !query output
26
- org.apache.spark.sql.AnalysisException
27
- Table or view not found: v; line 1 pos 92
25
+ 1582-05-31 19:40:35.123 1582-22-1 1582-22-01 1582-5-Mon 82 01582 Monday Mon Mon Mon Monday
26
+ 1969-12-31 15:00:00 1970-1-3 1970-01-03 1970-5-Wed 70 01970 Wednesday Wed Wed Wed Wednesday
27
+ 1970-12-31 04:59:59.999 1970-53-4 1970-53-04 1970-5-Thu 70 01970 Thursday Thu Thu Thu Thursday
28
+ 1996-03-31 07:03:33.123 1996-13-7 1996-13-07 1996-4-Sun 96 01996 Sunday Sun Sun Sun Sunday
29
+ 2018-11-17 05:33:33.123 2018-46-6 2018-46-06 2018-3-Sat 18 02018 Saturday Sat Sat Sat Saturday
30
+ 2019-12-31 09:33:33.123 2020-1-2 2020-01-02 2020-5-Tue 20 02020 Tuesday Tue Tue Tue Tuesday
31
+ 2100-01-01 01:33:33.123 2099-53-5 2099-53-05 2099-0-Fri 99 02099 Friday Fri Fri Fri Friday
28
32
29
33
30
34
-- !query
31
35
select col, date_format(col, 'q qq Q QQ QQQ QQQQ') from v
32
36
-- !query schema
33
- struct<>
37
+ struct<col:timestamp,date_format(col, q qq Q QQ QQQ QQQQ):string >
34
38
-- !query output
35
- org.apache.spark.sql.AnalysisException
36
- Table or view not found: v; line 1 pos 56
39
+ 1582-05-31 19:40:35.123 2 02 2 02 Q2 2nd quarter
40
+ 1969-12-31 15:00:00 4 04 4 04 Q4 4th quarter
41
+ 1970-12-31 04:59:59.999 4 04 4 04 Q4 4th quarter
42
+ 1996-03-31 07:03:33.123 1 01 1 01 Q1 1st quarter
43
+ 2018-11-17 05:33:33.123 4 04 4 04 Q4 4th quarter
44
+ 2019-12-31 09:33:33.123 4 04 4 04 Q4 4th quarter
45
+ 2100-01-01 01:33:33.123 1 01 1 01 Q1 1st quarter
37
46
38
47
39
48
-- !query
40
49
select col, date_format(col, 'y-M-d H:m:s yyyy-MM-dd HH:mm:ss.SSS yy yyy yyyyy MMM MMMM L LL F h hh k kk K KK a') from v
41
50
-- !query schema
42
- struct<>
51
+ struct<col:timestamp,date_format(col, y-M-d H:m:s yyyy-MM-dd HH:mm:ss.SSS yy yyy yyyyy MMM MMMM L LL F h hh k kk K KK a):string >
43
52
-- !query output
44
- org.apache.spark.sql.AnalysisException
45
- Table or view not found: v; line 1 pos 119
53
+ 1582-05-31 19:40:35.123 1582-5-31 19:40:35 1582-05-31 19:40:35.123 82 1582 01582 May May 5 05 3 7 07 19 19 7 07 PM
54
+ 1969-12-31 15:00:00 1969-12-31 15:0:0 1969-12-31 15:00:00.000 69 1969 01969 Dec December 12 12 3 3 03 15 15 3 03 PM
55
+ 1970-12-31 04:59:59.999 1970-12-31 4:59:59 1970-12-31 04:59:59.999 70 1970 01970 Dec December 12 12 3 4 04 4 04 4 04 AM
56
+ 1996-03-31 07:03:33.123 1996-3-31 7:3:33 1996-03-31 07:03:33.123 96 1996 01996 Mar March 3 03 3 7 07 7 07 7 07 AM
57
+ 2018-11-17 05:33:33.123 2018-11-17 5:33:33 2018-11-17 05:33:33.123 18 2018 02018 Nov November 11 11 3 5 05 5 05 5 05 AM
58
+ 2019-12-31 09:33:33.123 2019-12-31 9:33:33 2019-12-31 09:33:33.123 19 2019 02019 Dec December 12 12 3 9 09 9 09 9 09 AM
59
+ 2100-01-01 01:33:33.123 2100-1-1 1:33:33 2100-01-01 01:33:33.123 00 2100 02100 Jan January 1 01 1 1 01 1 01 1 01 AM
46
60
47
61
48
62
-- !query
49
63
select col, date_format(col, 'z zz zzz zzzz X XX XXX Z ZZ ZZZ ZZZZ ZZZZZ') from v
50
64
-- !query schema
51
- struct<>
65
+ struct<col:timestamp,date_format(col, z zz zzz zzzz X XX XXX Z ZZ ZZZ ZZZZ ZZZZZ):string >
52
66
-- !query output
53
- org.apache.spark.sql.AnalysisException
54
- Table or view not found: v; line 1 pos 81
67
+ 1582-05-31 19:40:35.123 PST PST PST Pacific Standard Time -0752 -0752 -07:52 -0752 -0752 -0752 GMT-07:52:58 -07:52:58
68
+ 1969-12-31 15:00:00 PST PST PST Pacific Standard Time -08 -0800 -08:00 -0800 -0800 -0800 GMT-08:00 -08:00
69
+ 1970-12-31 04:59:59.999 PST PST PST Pacific Standard Time -08 -0800 -08:00 -0800 -0800 -0800 GMT-08:00 -08:00
70
+ 1996-03-31 07:03:33.123 PST PST PST Pacific Standard Time -08 -0800 -08:00 -0800 -0800 -0800 GMT-08:00 -08:00
71
+ 2018-11-17 05:33:33.123 PST PST PST Pacific Standard Time -08 -0800 -08:00 -0800 -0800 -0800 GMT-08:00 -08:00
72
+ 2019-12-31 09:33:33.123 PST PST PST Pacific Standard Time -08 -0800 -08:00 -0800 -0800 -0800 GMT-08:00 -08:00
73
+ 2100-01-01 01:33:33.123 PST PST PST Pacific Standard Time -08 -0800 -08:00 -0800 -0800 -0800 GMT-08:00 -08:00
55
74
56
75
57
76
-- !query
58
77
select col, date_format(col, 'VV O OOOO XXXX XXXXX x xx xxx xxxx xxxx xxxxx') from v
59
78
-- !query schema
60
- struct<>
79
+ struct<col:timestamp,date_format(col, VV O OOOO XXXX XXXXX x xx xxx xxxx xxxx xxxxx):string >
61
80
-- !query output
62
- org.apache.spark.sql.AnalysisException
63
- Table or view not found: v; line 1 pos 83
81
+ 1582-05-31 19:40:35.123 America/Los_Angeles GMT-7:52:58 GMT-07:52:58 -075258 -07:52:58 -0752 -0752 -07:52 -075258 -075258 -07:52:58
82
+ 1969-12-31 15:00:00 America/Los_Angeles GMT-8 GMT-08:00 -0800 -08:00 -08 -0800 -08:00 -0800 -0800 -08:00
83
+ 1970-12-31 04:59:59.999 America/Los_Angeles GMT-8 GMT-08:00 -0800 -08:00 -08 -0800 -08:00 -0800 -0800 -08:00
84
+ 1996-03-31 07:03:33.123 America/Los_Angeles GMT-8 GMT-08:00 -0800 -08:00 -08 -0800 -08:00 -0800 -0800 -08:00
85
+ 2018-11-17 05:33:33.123 America/Los_Angeles GMT-8 GMT-08:00 -0800 -08:00 -08 -0800 -08:00 -0800 -0800 -08:00
86
+ 2019-12-31 09:33:33.123 America/Los_Angeles GMT-8 GMT-08:00 -0800 -08:00 -08 -0800 -08:00 -0800 -0800 -08:00
87
+ 2100-01-01 01:33:33.123 America/Los_Angeles GMT-8 GMT-08:00 -0800 -08:00 -08 -0800 -08:00 -0800 -0800 -08:00
64
88
65
89
66
90
-- !query
0 commit comments