@@ -8,66 +8,66 @@ create table t (m map (float, float));
8
8
db error: ERROR: Failed to run the query
9
9
10
10
Caused by:
11
- invalid map key type: double precision
11
+ Bind error: invalid map key type: double precision
12
12
13
13
14
14
query error
15
- select map_from_entries (array[1.0,2.0,3.0], array[1,2,3]);
15
+ select map_from_key_values (array[1.0,2.0,3.0], array[1,2,3]);
16
16
----
17
17
db error: ERROR: Failed to run the query
18
18
19
19
Caused by these errors (recent errors listed first):
20
- 1: Failed to bind expression: map_from_entries (ARRAY[1.0, 2.0, 3.0], ARRAY[1, 2, 3])
20
+ 1: Failed to bind expression: map_from_key_values (ARRAY[1.0, 2.0, 3.0], ARRAY[1, 2, 3])
21
21
2: Expr error
22
22
3: invalid map key type: numeric
23
23
24
24
25
25
query error
26
- select map_from_entries (array[1,1,3], array[1,2,3]);
26
+ select map_from_key_values (array[1,1,3], array[1,2,3]);
27
27
----
28
28
db error: ERROR: Failed to run the query
29
29
30
30
Caused by these errors (recent errors listed first):
31
31
1: Expr error
32
- 2: error while evaluating expression `map_from_entries ('{1,1,3}', '{1,2,3}')`
32
+ 2: error while evaluating expression `map_from_key_values ('{1,1,3}', '{1,2,3}')`
33
33
3: map keys must be unique
34
34
35
35
36
36
query ?
37
- select map_from_entries (array[1,2,3], array[1,null,3]);
37
+ select map_from_key_values (array[1,2,3], array[1,null,3]);
38
38
----
39
39
{1:1,2:NULL,3:3}
40
40
41
41
42
42
query error
43
- select map_from_entries (array[1,null,3], array[1,2,3]);
43
+ select map_from_key_values (array[1,null,3], array[1,2,3]);
44
44
----
45
45
db error: ERROR: Failed to run the query
46
46
47
47
Caused by these errors (recent errors listed first):
48
48
1: Expr error
49
- 2: error while evaluating expression `map_from_entries ('{1,NULL,3}', '{1,2,3}')`
49
+ 2: error while evaluating expression `map_from_key_values ('{1,NULL,3}', '{1,2,3}')`
50
50
3: map keys must not be NULL
51
51
52
52
53
53
query error
54
- select map_from_entries (array[1,3], array[1,2,3]);
54
+ select map_from_key_values (array[1,3], array[1,2,3]);
55
55
----
56
56
db error: ERROR: Failed to run the query
57
57
58
58
Caused by these errors (recent errors listed first):
59
59
1: Expr error
60
- 2: error while evaluating expression `map_from_entries ('{1,3}', '{1,2,3}')`
60
+ 2: error while evaluating expression `map_from_key_values ('{1,3}', '{1,2,3}')`
61
61
3: map keys and values have different length
62
62
63
63
64
64
query error
65
- select map_from_entries (array[1,2], array[1,2]) = map_from_entries (array[2,1], array[2,1]);
65
+ select map_from_key_values (array[1,2], array[1,2]) = map_from_key_values (array[2,1], array[2,1]);
66
66
----
67
67
db error: ERROR: Failed to run the query
68
68
69
69
Caused by these errors (recent errors listed first):
70
- 1: Failed to bind expression: map_from_entries (ARRAY[1, 2], ARRAY[1, 2]) = map_from_entries (ARRAY[2, 1], ARRAY[2, 1])
70
+ 1: Failed to bind expression: map_from_key_values (ARRAY[1, 2], ARRAY[1, 2]) = map_from_key_values (ARRAY[2, 1], ARRAY[2, 1])
71
71
2: function equal(map(integer,integer), map(integer,integer)) does not exist
72
72
73
73
@@ -83,32 +83,32 @@ create table t (
83
83
84
84
statement ok
85
85
insert into t values (
86
- map_from_entries (array['a','b','c'], array[1.0,2.0,3.0]::float[]),
87
- map_from_entries (array[1,2,3], array[true,false,true]),
88
- map_from_entries (array['a','b'],
86
+ map_from_key_values (array['a','b','c'], array[1.0,2.0,3.0]::float[]),
87
+ map_from_key_values (array[1,2,3], array[true,false,true]),
88
+ map_from_key_values (array['a','b'],
89
89
array[
90
- map_from_entries (array['a1'], array['a2']),
91
- map_from_entries (array['b1'], array['b2'])
90
+ map_from_key_values (array['a1'], array['a2']),
91
+ map_from_key_values (array['b1'], array['b2'])
92
92
]
93
93
),
94
94
array[
95
- map_from_entries (array['a','b','c'], array[1,2,3]),
96
- map_from_entries (array['d','e','f'], array[4,5,6])
95
+ map_from_key_values (array['a','b','c'], array[1,2,3]),
96
+ map_from_key_values (array['d','e','f'], array[4,5,6])
97
97
],
98
98
row(
99
- map_from_entries (array['a','b','c'], array[row(1),row(2),row(3)]::struct<x int>[])
99
+ map_from_key_values (array['a','b','c'], array[row(1),row(2),row(3)]::struct<x int>[])
100
100
)
101
101
);
102
102
103
103
# cast(map(character varying,integer)) -> map(character varying,double precision)
104
104
query ?
105
- select map_from_entries (array['a','b','c'], array[1,2,3])::map(varchar,float);
105
+ select map_from_key_values (array['a','b','c'], array[1,2,3])::map(varchar,float);
106
106
----
107
107
{a:1,b:2,c:3}
108
108
109
109
110
110
statement ok
111
- insert into t(m1) values (map_from_entries (array['a','b','c'], array[1,2,3]));
111
+ insert into t(m1) values (map_from_key_values (array['a','b','c'], array[1,2,3]));
112
112
113
113
query ????? rowsort
114
114
select * from t;
@@ -144,7 +144,7 @@ db error: ERROR: Failed to run the query
144
144
145
145
Caused by these errors (recent errors listed first):
146
146
1: Expr error
147
- 2: error while evaluating expression `map_from_entries ('{a,a}', '{1,2}')`
147
+ 2: error while evaluating expression `map_from_key_values ('{a,a}', '{1,2}')`
148
148
3: map keys must be unique
149
149
150
150
@@ -165,3 +165,96 @@ select
165
165
MAP{1:'a',2:'b'}::MAP(VARCHAR,VARCHAR)
166
166
----
167
167
{} {1:a,2:b}
168
+
169
+ query error
170
+ select map_from_entries(array[]);
171
+ ----
172
+ db error: ERROR: Failed to run the query
173
+
174
+ Caused by these errors (recent errors listed first):
175
+ 1: Failed to bind expression: map_from_entries(ARRAY[])
176
+ 2: Bind error: cannot determine type of empty array
177
+ HINT: Explicitly cast to the desired type, for example ARRAY[]::integer[].
178
+
179
+
180
+ query error
181
+ select map_from_entries(array[]::int[]);
182
+ ----
183
+ db error: ERROR: Failed to run the query
184
+
185
+ Caused by these errors (recent errors listed first):
186
+ 1: Failed to bind expression: map_from_entries(CAST(ARRAY[] AS INT[]))
187
+ 2: Expr error
188
+ 3: invalid map entries type, expected struct, got: integer
189
+
190
+
191
+ query error
192
+ select map_from_entries(array[]::struct<key float, value int>[]);
193
+ ----
194
+ db error: ERROR: Failed to run the query
195
+
196
+ Caused by these errors (recent errors listed first):
197
+ 1: Failed to bind expression: map_from_entries(CAST(ARRAY[] AS STRUCT<key FLOAT, value INT>[]))
198
+ 2: Expr error
199
+ 3: invalid map key type: double precision
200
+
201
+
202
+ query ?
203
+ select map_from_entries(array[]::struct<key int, value int>[]);
204
+ ----
205
+ {}
206
+
207
+
208
+ query ?
209
+ select map_from_entries(array[row('a',1), row('b',2), row('c',3)]);
210
+ ----
211
+ {a:1,b:2,c:3}
212
+
213
+
214
+ query error
215
+ select map_from_entries(array[row('a',1), row('a',2), row('c',3)]);
216
+ ----
217
+ db error: ERROR: Failed to run the query
218
+
219
+ Caused by these errors (recent errors listed first):
220
+ 1: Expr error
221
+ 2: error while evaluating expression `map_from_entries('{"(a,1)","(a,2)","(c,3)"}')`
222
+ 3: map keys must be unique
223
+
224
+
225
+ query error
226
+ select map_from_entries(array[row('a',1,2)]);
227
+ ----
228
+ db error: ERROR: Failed to run the query
229
+
230
+ Caused by these errors (recent errors listed first):
231
+ 1: Failed to bind expression: map_from_entries(ARRAY[ROW('a', 1, 2)])
232
+ 2: Expr error
233
+ 3: the underlying struct for map must have exactly two fields, got: StructType { field_names: [], field_types: [Varchar, Int32, Int32] }
234
+
235
+
236
+ query error
237
+ select map_from_entries(array[row(1.0,1)]);
238
+ ----
239
+ db error: ERROR: Failed to run the query
240
+
241
+ Caused by these errors (recent errors listed first):
242
+ 1: Failed to bind expression: map_from_entries(ARRAY[ROW(1.0, 1)])
243
+ 2: Expr error
244
+ 3: invalid map key type: numeric
245
+
246
+
247
+ query error
248
+ select map_from_entries(null);
249
+ ----
250
+ db error: ERROR: Failed to run the query
251
+
252
+ Caused by these errors (recent errors listed first):
253
+ 1: Failed to bind expression: map_from_entries(NULL)
254
+ 2: Bind error: Cannot implicitly cast 'null:Varchar' to polymorphic type AnyArray
255
+
256
+
257
+ query ?
258
+ select map_from_entries(null::struct<key int, value int>[]);
259
+ ----
260
+ NULL
0 commit comments