Skip to content

Commit

Permalink
sql tests for array of primitive type and of arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGekk committed Aug 24, 2018
1 parent fb72726 commit e9a5f50
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ select from_json('[null, {"a":2}]', 'array<struct<a:int>>');

select from_json('[{"a": 1}, {"b":2}]', 'array<map<string,int>>');
select from_json('[{"a": 1}, 2]', 'array<map<string,int>>');

-- to_json - array type
select to_json(array('1','2','3'));
select to_json(array(array(1,2,3),array(4)));

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 38
-- Number of queries: 40


-- !query 0
Expand Down Expand Up @@ -354,3 +354,19 @@ select from_json('[{"a": 1}, 2]', 'array<map<string,int>>')
struct<jsontostructs([{"a": 1}, 2]):array<map<string,int>>>
-- !query 37 output
NULL


-- !query 38
select to_json(array('1','2','3'))
-- !query 38 schema
struct<structstojson(array(1, 2, 3)):string>
-- !query 38 output
["1","2","3"]


-- !query 39
select to_json(array(array(1,2,3),array(4)))
-- !query 39 schema
struct<structstojson(array(array(1, 2, 3), array(4))):string>
-- !query 39 output
[[1,2,3],[4]]

0 comments on commit e9a5f50

Please sign in to comment.