@@ -44,63 +44,63 @@ Usage: to_json(expr[, options]) - Returns a JSON string with a given struct valu
4444-- !query 2
4545select to_json(named_struct('a', 1, 'b', 2))
4646-- !query 2 schema
47- struct<structstojson (named_struct(a, 1, b, 2)):string>
47+ struct<to_json (named_struct(a, 1, b, 2)):string>
4848-- !query 2 output
4949{"a":1,"b":2}
5050
5151
5252-- !query 3
5353select to_json(named_struct('time', to_timestamp('2015-08-26', 'yyyy-MM-dd')), map('timestampFormat', 'dd/MM/yyyy'))
5454-- !query 3 schema
55- struct<structstojson (named_struct(time, to_timestamp('2015-08-26', 'yyyy-MM-dd'))):string>
55+ struct<to_json (named_struct(time, to_timestamp('2015-08-26', 'yyyy-MM-dd'))):string>
5656-- !query 3 output
5757{"time":"26/08/2015"}
5858
5959
6060-- !query 4
6161select to_json(array(named_struct('a', 1, 'b', 2)))
6262-- !query 4 schema
63- struct<structstojson (array(named_struct(a, 1, b, 2))):string>
63+ struct<to_json (array(named_struct(a, 1, b, 2))):string>
6464-- !query 4 output
6565[{"a":1,"b":2}]
6666
6767
6868-- !query 5
6969select to_json(map(named_struct('a', 1, 'b', 2), named_struct('a', 1, 'b', 2)))
7070-- !query 5 schema
71- struct<structstojson (map(named_struct(a, 1, b, 2), named_struct(a, 1, b, 2))):string>
71+ struct<to_json (map(named_struct(a, 1, b, 2), named_struct(a, 1, b, 2))):string>
7272-- !query 5 output
7373{"[1,2]":{"a":1,"b":2}}
7474
7575
7676-- !query 6
7777select to_json(map('a', named_struct('a', 1, 'b', 2)))
7878-- !query 6 schema
79- struct<structstojson (map(a, named_struct(a, 1, b, 2))):string>
79+ struct<to_json (map(a, named_struct(a, 1, b, 2))):string>
8080-- !query 6 output
8181{"a":{"a":1,"b":2}}
8282
8383
8484-- !query 7
8585select to_json(map('a', 1))
8686-- !query 7 schema
87- struct<structstojson (map(a, 1)):string>
87+ struct<to_json (map(a, 1)):string>
8888-- !query 7 output
8989{"a":1}
9090
9191
9292-- !query 8
9393select to_json(array(map('a',1)))
9494-- !query 8 schema
95- struct<structstojson (array(map(a, 1))):string>
95+ struct<to_json (array(map(a, 1))):string>
9696-- !query 8 output
9797[{"a":1}]
9898
9999
100100-- !query 9
101101select to_json(array(map('a',1), map('b',2)))
102102-- !query 9 schema
103- struct<structstojson (array(map(a, 1), map(b, 2))):string>
103+ struct<to_json (array(map(a, 1), map(b, 2))):string>
104104-- !query 9 output
105105[{"a":1},{"b":2}]
106106
@@ -164,15 +164,15 @@ Usage: from_json(jsonStr, schema[, options]) - Returns a struct value with the g
164164-- !query 15
165165select from_json('{"a":1}', 'a INT')
166166-- !query 15 schema
167- struct<jsontostructs ({"a":1}):struct<a:int>>
167+ struct<from_json ({"a":1}):struct<a:int>>
168168-- !query 15 output
169169{"a":1}
170170
171171
172172-- !query 16
173173select from_json('{"time":"26/08/2015"}', 'time Timestamp', map('timestampFormat', 'dd/MM/yyyy'))
174174-- !query 16 schema
175- struct<jsontostructs ({"time":"26/08/2015"}):struct<time:timestamp>>
175+ struct<from_json ({"time":"26/08/2015"}):struct<time:timestamp>>
176176-- !query 16 output
177177{"time":2015-08-26 00:00:00.0}
178178
@@ -271,118 +271,118 @@ struct<entries:map<string,int>>
271271-- !query 27
272272select from_json('{"a":1, "b":"2"}', 'struct<a:int,b:string>')
273273-- !query 27 schema
274- struct<jsontostructs ({"a":1, "b":"2"}):struct<a:int,b:string>>
274+ struct<from_json ({"a":1, "b":"2"}):struct<a:int,b:string>>
275275-- !query 27 output
276276{"a":1,"b":"2"}
277277
278278
279279-- !query 28
280280select schema_of_json('{"c1":0, "c2":[1]}')
281281-- !query 28 schema
282- struct<schemaofjson ({"c1":0, "c2":[1]}):string>
282+ struct<schema_of_json ({"c1":0, "c2":[1]}):string>
283283-- !query 28 output
284284struct<c1:bigint,c2:array<bigint>>
285285
286286
287287-- !query 29
288288select from_json('{"c1":[1, 2, 3]}', schema_of_json('{"c1":[0]}'))
289289-- !query 29 schema
290- struct<jsontostructs ({"c1":[1, 2, 3]}):struct<c1:array<bigint>>>
290+ struct<from_json ({"c1":[1, 2, 3]}):struct<c1:array<bigint>>>
291291-- !query 29 output
292292{"c1":[1,2,3]}
293293
294294
295295-- !query 30
296296select from_json('[1, 2, 3]', 'array<int>')
297297-- !query 30 schema
298- struct<jsontostructs ([1, 2, 3]):array<int>>
298+ struct<from_json ([1, 2, 3]):array<int>>
299299-- !query 30 output
300300[1,2,3]
301301
302302
303303-- !query 31
304304select from_json('[1, "2", 3]', 'array<int>')
305305-- !query 31 schema
306- struct<jsontostructs ([1, "2", 3]):array<int>>
306+ struct<from_json ([1, "2", 3]):array<int>>
307307-- !query 31 output
308308NULL
309309
310310
311311-- !query 32
312312select from_json('[1, 2, null]', 'array<int>')
313313-- !query 32 schema
314- struct<jsontostructs ([1, 2, null]):array<int>>
314+ struct<from_json ([1, 2, null]):array<int>>
315315-- !query 32 output
316316[1,2,null]
317317
318318
319319-- !query 33
320320select from_json('[{"a": 1}, {"a":2}]', 'array<struct<a:int>>')
321321-- !query 33 schema
322- struct<jsontostructs ([{"a": 1}, {"a":2}]):array<struct<a:int>>>
322+ struct<from_json ([{"a": 1}, {"a":2}]):array<struct<a:int>>>
323323-- !query 33 output
324324[{"a":1},{"a":2}]
325325
326326
327327-- !query 34
328328select from_json('{"a": 1}', 'array<struct<a:int>>')
329329-- !query 34 schema
330- struct<jsontostructs ({"a": 1}):array<struct<a:int>>>
330+ struct<from_json ({"a": 1}):array<struct<a:int>>>
331331-- !query 34 output
332332[{"a":1}]
333333
334334
335335-- !query 35
336336select from_json('[null, {"a":2}]', 'array<struct<a:int>>')
337337-- !query 35 schema
338- struct<jsontostructs ([null, {"a":2}]):array<struct<a:int>>>
338+ struct<from_json ([null, {"a":2}]):array<struct<a:int>>>
339339-- !query 35 output
340340[null,{"a":2}]
341341
342342
343343-- !query 36
344344select from_json('[{"a": 1}, {"b":2}]', 'array<map<string,int>>')
345345-- !query 36 schema
346- struct<jsontostructs ([{"a": 1}, {"b":2}]):array<map<string,int>>>
346+ struct<from_json ([{"a": 1}, {"b":2}]):array<map<string,int>>>
347347-- !query 36 output
348348[{"a":1},{"b":2}]
349349
350350
351351-- !query 37
352352select from_json('[{"a": 1}, 2]', 'array<map<string,int>>')
353353-- !query 37 schema
354- struct<jsontostructs ([{"a": 1}, 2]):array<map<string,int>>>
354+ struct<from_json ([{"a": 1}, 2]):array<map<string,int>>>
355355-- !query 37 output
356356NULL
357357
358358
359359-- !query 38
360360select to_json(array('1', '2', '3'))
361361-- !query 38 schema
362- struct<structstojson (array(1, 2, 3)):string>
362+ struct<to_json (array(1, 2, 3)):string>
363363-- !query 38 output
364364["1","2","3"]
365365
366366
367367-- !query 39
368368select to_json(array(array(1, 2, 3), array(4)))
369369-- !query 39 schema
370- struct<structstojson (array(array(1, 2, 3), array(4))):string>
370+ struct<to_json (array(array(1, 2, 3), array(4))):string>
371371-- !query 39 output
372372[[1,2,3],[4]]
373373
374374
375375-- !query 40
376376select schema_of_json('{"c1":1}', map('primitivesAsString', 'true'))
377377-- !query 40 schema
378- struct<schemaofjson ({"c1":1}):string>
378+ struct<schema_of_json ({"c1":1}):string>
379379-- !query 40 output
380380struct<c1:string>
381381
382382
383383-- !query 41
384384select schema_of_json('{"c1":01, "c2":0.1}', map('allowNumericLeadingZeros', 'true', 'prefersDecimal', 'true'))
385385-- !query 41 schema
386- struct<schemaofjson ({"c1":01, "c2":0.1}):string>
386+ struct<schema_of_json ({"c1":01, "c2":0.1}):string>
387387-- !query 41 output
388388struct<c1:bigint,c2:decimal(1,1)>
0 commit comments