1
1
-- Automatically generated by SQLQueryTestSuite
2
- -- Number of queries: 24
2
+ -- Number of queries: 26
3
3
4
4
5
5
-- !query 0
@@ -45,12 +45,12 @@ c int
45
45
46
46
47
47
-- !query 4
48
- ALTER TABLE test_change CHANGE a TYPE STRING
48
+ ALTER TABLE test_change RENAME COLUMN a TO a1
49
49
-- !query 4 schema
50
50
struct<>
51
51
-- !query 4 output
52
52
org.apache.spark.sql.AnalysisException
53
- ALTER COLUMN is only supported with v2 tables.;
53
+ RENAME COLUMN is only supported with v2 tables.;
54
54
55
55
56
56
-- !query 5
@@ -64,10 +64,29 @@ c int
64
64
65
65
66
66
-- !query 6
67
- ALTER TABLE test_change CHANGE a TYPE INT AFTER b
67
+ ALTER TABLE test_change CHANGE a TYPE STRING
68
68
-- !query 6 schema
69
69
struct<>
70
70
-- !query 6 output
71
+ org.apache.spark.sql.AnalysisException
72
+ ALTER TABLE CHANGE COLUMN is not supported for changing column 'a' with type 'IntegerType' to 'a' with type 'StringType';
73
+
74
+
75
+ -- !query 7
76
+ DESC test_change
77
+ -- !query 7 schema
78
+ struct<col_name:string,data_type:string,comment:string>
79
+ -- !query 7 output
80
+ a int
81
+ b string
82
+ c int
83
+
84
+
85
+ -- !query 8
86
+ ALTER TABLE test_change CHANGE a TYPE INT AFTER b
87
+ -- !query 8 schema
88
+ struct<>
89
+ -- !query 8 output
71
90
org.apache.spark.sql.catalyst.parser.ParseException
72
91
73
92
Operation not allowed: ALTER TABLE table CHANGE COLUMN ... FIRST | AFTER otherCol(line 1, pos 0)
@@ -77,11 +96,11 @@ ALTER TABLE test_change CHANGE a TYPE INT AFTER b
77
96
^^^
78
97
79
98
80
- -- !query 7
99
+ -- !query 9
81
100
ALTER TABLE test_change CHANGE b TYPE STRING FIRST
82
- -- !query 7 schema
101
+ -- !query 9 schema
83
102
struct<>
84
- -- !query 7 output
103
+ -- !query 9 output
85
104
org.apache.spark.sql.catalyst.parser.ParseException
86
105
87
106
Operation not allowed: ALTER TABLE table CHANGE COLUMN ... FIRST | AFTER otherCol(line 1, pos 0)
@@ -91,145 +110,141 @@ ALTER TABLE test_change CHANGE b TYPE STRING FIRST
91
110
^^^
92
111
93
112
94
- -- !query 8
113
+ -- !query 10
95
114
DESC test_change
96
- -- !query 8 schema
115
+ -- !query 10 schema
97
116
struct<col_name:string,data_type:string,comment:string>
98
- -- !query 8 output
117
+ -- !query 10 output
99
118
a int
100
119
b string
101
120
c int
102
121
103
122
104
- -- !query 9
105
- ALTER TABLE test_change CHANGE a TYPE INT COMMENT 'this is column a'
106
- -- !query 9 schema
107
- struct<>
108
- -- !query 9 output
109
- org.apache.spark.sql.AnalysisException
110
- ALTER COLUMN is only supported with v2 tables.;
111
-
112
-
113
- -- !query 10
114
- ALTER TABLE test_change CHANGE b TYPE STRING COMMENT '#*02?`'
115
- -- !query 10 schema
116
- struct<>
117
- -- !query 10 output
118
- org.apache.spark.sql.AnalysisException
119
- ALTER COLUMN is only supported with v2 tables.;
120
-
121
-
122
123
-- !query 11
123
- ALTER TABLE test_change CHANGE c TYPE INT COMMENT ''
124
+ ALTER TABLE test_change CHANGE a TYPE INT COMMENT 'this is column a '
124
125
-- !query 11 schema
125
126
struct<>
126
127
-- !query 11 output
127
- org.apache.spark.sql.AnalysisException
128
- ALTER COLUMN is only supported with v2 tables.;
128
+
129
129
130
130
131
131
-- !query 12
132
- DESC test_change
132
+ ALTER TABLE test_change CHANGE b TYPE STRING COMMENT '#*02?`'
133
133
-- !query 12 schema
134
- struct<col_name:string,data_type:string,comment:string >
134
+ struct<>
135
135
-- !query 12 output
136
- a int
137
- b string
138
- c int
136
+
139
137
140
138
141
139
-- !query 13
142
- ALTER TABLE test_change CHANGE a TYPE INT COMMENT 'this is column a '
140
+ ALTER TABLE test_change CHANGE c TYPE INT COMMENT ''
143
141
-- !query 13 schema
144
142
struct<>
145
143
-- !query 13 output
146
- org.apache.spark.sql.AnalysisException
147
- ALTER COLUMN is only supported with v2 tables.;
144
+
148
145
149
146
150
147
-- !query 14
151
148
DESC test_change
152
149
-- !query 14 schema
153
150
struct<col_name:string,data_type:string,comment:string>
154
151
-- !query 14 output
155
- a int
156
- b string
152
+ a int this is column a
153
+ b string #*02?`
157
154
c int
158
155
159
156
160
157
-- !query 15
161
- ALTER TABLE test_change CHANGE invalid_col TYPE INT
158
+ ALTER TABLE test_change CHANGE a TYPE INT COMMENT 'this is column a'
162
159
-- !query 15 schema
163
160
struct<>
164
161
-- !query 15 output
165
- org.apache.spark.sql.AnalysisException
166
- ALTER COLUMN is only supported with v2 tables.;
162
+
167
163
168
164
169
165
-- !query 16
170
166
DESC test_change
171
167
-- !query 16 schema
172
168
struct<col_name:string,data_type:string,comment:string>
173
169
-- !query 16 output
174
- a int
175
- b string
170
+ a int this is column a
171
+ b string #*02?`
176
172
c int
177
173
178
174
179
175
-- !query 17
180
- CREATE TEMPORARY VIEW temp_view(a, b) AS SELECT 1, "one"
176
+ ALTER TABLE test_change CHANGE invalid_col TYPE INT
181
177
-- !query 17 schema
182
178
struct<>
183
179
-- !query 17 output
184
-
180
+ org.apache.spark.sql.AnalysisException
181
+ Can't find column `invalid_col` given table data columns [`a`, `b`, `c`];
185
182
186
183
187
184
-- !query 18
188
- ALTER TABLE temp_view CHANGE a TYPE INT COMMENT 'this is column a'
185
+ DESC test_change
189
186
-- !query 18 schema
190
- struct<>
187
+ struct<col_name:string,data_type:string,comment:string >
191
188
-- !query 18 output
192
- org.apache.spark.sql.AnalysisException
193
- Invalid command: 'temp_view' is a view not a table.; line 1 pos 0
189
+ a int this is column a
190
+ b string #*02?`
191
+ c int
194
192
195
193
196
194
-- !query 19
197
- CREATE GLOBAL TEMPORARY VIEW global_temp_view (a, b) AS SELECT 1, "one"
195
+ CREATE TEMPORARY VIEW temp_view (a, b) AS SELECT 1, "one"
198
196
-- !query 19 schema
199
197
struct<>
200
198
-- !query 19 output
201
199
202
200
203
201
204
202
-- !query 20
205
- ALTER TABLE global_temp.global_temp_view CHANGE a TYPE INT COMMENT 'this is column a'
203
+ ALTER TABLE temp_view CHANGE a TYPE INT COMMENT 'this is column a'
206
204
-- !query 20 schema
207
205
struct<>
208
206
-- !query 20 output
209
207
org.apache.spark.sql.AnalysisException
210
- Invalid command: 'global_temp.global_temp_view ' is a view not a table.; line 1 pos 0
208
+ Invalid command: 'temp_view ' is a view not a table.; line 1 pos 0
211
209
212
210
213
211
-- !query 21
214
- DROP TABLE test_change
212
+ CREATE GLOBAL TEMPORARY VIEW global_temp_view(a, b) AS SELECT 1, "one"
215
213
-- !query 21 schema
216
214
struct<>
217
215
-- !query 21 output
218
216
219
217
220
218
221
219
-- !query 22
222
- DROP TABLE partition_table
220
+ ALTER TABLE global_temp.global_temp_view CHANGE a TYPE INT COMMENT 'this is column a'
223
221
-- !query 22 schema
224
222
struct<>
225
223
-- !query 22 output
226
224
org.apache.spark.sql.AnalysisException
227
- Table or view not found: partition_table;
225
+ Invalid command: 'global_temp.global_temp_view' is a view not a table.; line 1 pos 0
228
226
229
227
230
228
-- !query 23
231
- DROP VIEW global_temp.global_temp_view
229
+ DROP TABLE test_change
232
230
-- !query 23 schema
233
231
struct<>
234
232
-- !query 23 output
235
233
234
+
235
+
236
+ -- !query 24
237
+ DROP TABLE partition_table
238
+ -- !query 24 schema
239
+ struct<>
240
+ -- !query 24 output
241
+ org.apache.spark.sql.AnalysisException
242
+ Table or view not found: partition_table;
243
+
244
+
245
+ -- !query 25
246
+ DROP VIEW global_temp.global_temp_view
247
+ -- !query 25 schema
248
+ struct<>
249
+ -- !query 25 output
250
+
0 commit comments