blob: 03826349220ba3a88e6b598a79bbdbed2743f406 [file] [log] [blame]
# name: test/sql/function/json/test_json.test
# description: Just simple test to check support of JSON functions
# group: [json]
query R
select JSON_EXISTS('{"info":{"address":[{"town":"Paris"},{"town":"London"}]}}','$.info.address[0].town')
----
true
query R
select JSON_VALUE('{"info":{"address":[{"town":"Paris"},{"town":"London"}]}}','$.info.address[0].town')
----
Paris
query R
select JSON_QUERY('{"info":{"address":[{"town":"Paris"},{"town":"London"}]}}','$.info.address')
----
[{"town":"Paris"},{"town":"London"}]
query R
SELECT JSON_OBJECT (KEY 'companyId' VALUE '1', KEY 'companyName' VALUE 'GRIDGAIN')
----
{"companyId":"1","companyName":"GRIDGAIN"}
query R
SELECT JSON_ARRAY ('test', 1, 4.2)
----
["test",1,4.2]