Changeset: 75f047d3107c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/75f047d3107c
Modified Files:
sql/test/nested/Tests/jdocs-direct-list.test.in
sql/test/nested/Tests/jdocs-wrapped-list.test.in
Branch: nested
Log Message:
Enables read_nd_json case for jdocs tests
diffs (198 lines):
diff --git a/sql/test/nested/Tests/jdocs-direct-list.test.in
b/sql/test/nested/Tests/jdocs-direct-list.test.in
--- a/sql/test/nested/Tests/jdocs-direct-list.test.in
+++ b/sql/test/nested/Tests/jdocs-direct-list.test.in
@@ -44,11 +44,20 @@ select json from '$TSTSRCDIR/jdocs-direc
statement ok
insert into jdocs select json from
'$TSTSRCDIR/jdocs-direct-list-list-format.json'
-## CRASH
-##query T nosort list-format-file
-##select json from '$TSTSRCDIR/jdocs-direct-list-newline-format.json'
-##----
-##TODO
+query T nosort newline-format-file
+select * from read_nd_json('$TSTSRCDIR/jdocs-direct-list-newline-format.json')
+----
+{"name":"test_five","id":405,"actions":[{"elem":{"key":"one","val":50}},{"elem":{"key":"two","val":51}}]}
+{"name":"test_six","id":406,"actions":[{"elem":{"key":"hi","val":60}},
{"elem":{"key":"low","val":61}}]}
+
+query T nosort newline-format-file
+select json from
read_nd_json('$TSTSRCDIR/jdocs-direct-list-newline-format.json')
+----
+{"name":"test_five","id":405,"actions":[{"elem":{"key":"one","val":50}},{"elem":{"key":"two","val":51}}]}
+{"name":"test_six","id":406,"actions":[{"elem":{"key":"hi","val":60}},
{"elem":{"key":"low","val":61}}]}
+
+statement ok
+insert into jdocs select json from
read_nd_json('$TSTSRCDIR/jdocs-direct-list-newline-format.json')
query TIT nosort
select jd.name, jd.id, ua.elem from jdocs, unnest(jd.actions) as ua
@@ -77,19 +86,18 @@ 404
test_four
404
("bc", 41)
-
-#test_five
-#405
-#("xy", 50)
-#test_five
-#405
-#("yz", 51)
-#test_four
-#406
-#("ab", 60)
-#test_four
-#406
-#("bc", 61)
+test_five
+405
+("one", 50)
+test_five
+405
+("two", 51)
+test_six
+406
+("hi", 60)
+test_six
+406
+("low", 61)
query TITI nosort
select jd.name, jd.id, ua.elem.key, ua.elem.val from jdocs, unnest(jd.actions)
as ua
@@ -126,21 +134,20 @@ test_four
404
bc
41
+test_five
+405
+one
+50
+test_five
+405
+two
+51
+test_six
+406
+hi
+60
+test_six
+406
+low
+61
-#test_five
-#405
-#xy
-#50
-#test_five
-#405
-#yz
-#51
-#test_four
-#406
-#ab
-#60
-#test_four
-#406
-#bc
-#61
-
diff --git a/sql/test/nested/Tests/jdocs-wrapped-list.test.in
b/sql/test/nested/Tests/jdocs-wrapped-list.test.in
--- a/sql/test/nested/Tests/jdocs-wrapped-list.test.in
+++ b/sql/test/nested/Tests/jdocs-wrapped-list.test.in
@@ -47,11 +47,20 @@ select json from '$TSTSRCDIR/jdocs-wrapp
statement ok
insert into jdocs select json from
'$TSTSRCDIR/jdocs-wrapped-list-list-format.json'
-## CRASH
-##query T nosort list-format-file
-##select json from '$TSTSRCDIR/jdocs-wrapped-list-newline-format.json'
-##----
-##TODO
+query T nosort newline-format-file
+select json from
read_nd_json('$TSTSRCDIR/jdocs-wrapped-list-newline-format.json')
+----
+{"name":"test_five","id":405,"actions":{"list":[{"elem":{"key":"one","val":50}},{"elem":{"key":"two","val":51}}]}}
+{"name":"test_six","id":406,"actions":{"list":[{"elem":{"key":"hi","val":60}},
{"elem":{"key":"low","val":61}}]}}
+
+query T nosort newline-format-file
+select json from
read_nd_json('$TSTSRCDIR/jdocs-wrapped-list-newline-format.json')
+----
+{"name":"test_five","id":405,"actions":{"list":[{"elem":{"key":"one","val":50}},{"elem":{"key":"two","val":51}}]}}
+{"name":"test_six","id":406,"actions":{"list":[{"elem":{"key":"hi","val":60}},
{"elem":{"key":"low","val":61}}]}}
+
+statement ok
+insert into jdocs select json from
read_nd_json('$TSTSRCDIR/jdocs-wrapped-list-newline-format.json')
query TIT nosort
select jd.name, jd.id, ua.elem from jdocs, unnest(jd.actions.list) as ua
@@ -80,19 +89,18 @@ 404
test_four
404
("bc", 41)
-
-#test_five
-#405
-#("xy", 50)
-#test_five
-#405
-#("yz", 51)
-#test_four
-#406
-#("ab", 60)
-#test_four
-#406
-#("bc", 61)
+test_five
+405
+("one", 50)
+test_five
+405
+("two", 51)
+test_six
+406
+("hi", 60)
+test_six
+406
+("low", 61)
query TITI nosort
select jd.name, jd.id, ua.elem.key, ua.elem.val from jdocs,
unnest(jd.actions.list) as ua
@@ -129,21 +137,20 @@ test_four
404
bc
41
+test_five
+405
+one
+50
+test_five
+405
+two
+51
+test_six
+406
+hi
+60
+test_six
+406
+low
+61
-#test_five
-#405
-#xy
-#50
-#test_five
-#405
-#yz
-#51
-#test_four
-#406
-#ab
-#60
-#test_four
-#406
-#bc
-#61
-
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]