create schema test_json_pretty;
set current_schema to 'test_json_pretty';
select JSON_PRETTY('{"a": 43}');
select JSON_PRETTY('true');
select JSON_PRETTY('false');
select JSON_PRETTY('1');
select JSON_PRETTY('"hello world"');
select JSON_PRETTY('[1,3,4]');
select JSON_PRETTY('["a"]');
select JSON_PRETTY('["a", "b"]');
select JSON_PRETTY('["a", 232]');
select JSON_PRETTY('["a", true, false]');
select JSON_PRETTY('["a", ["a"]]');
select JSON_PRETTY('["a", {"a": "hello"}]');
select JSON_PRETTY('[111, {"a": "hello"}]');
select JSON_PRETTY('{}');
select JSON_PRETTY('[]');
select JSON_PRETTY('{"a": {}}');
select JSON_PRETTY('{"a": []}');
select JSON_PRETTY('[{}]');
select JSON_PRETTY('[[]]');
select JSON_PRETTY('["a", []]');
select JSON_PRETTY('["a", {}]');
select JSON_PRETTY(null);
select JSON_PRETTY('{aa,b}');
select JSON_PRETTY('[*]');
select JSON_PRETTY('["a, []]');
select JSON_PRETTY('{'a':3}');
SELECT JSON_PRETTY('');
SELECT JSON_PRETTY(122323);
select JSON_PRETTY('{"a": }');
select JSON_PRETTY('{a: 43}');
SELECT JSON_PRETTY('{
"Person": {
"Name": "Homer",
"Age": 39,
"Hobbies": ["Eating", "Sleeping"]
}
}');
select JSON_PRETTY('{"a":[{"age": 43, "name": "lihua"}, [[[[43,33, []]]]], "hello"]}');
SELECT JSON_PRETTY(json_build_object('name', 'Lihua'));
select JSON_PRETTY(json_build_object('name', 'Lihua', 'age', '43'));
select json_build_object('ob',JSON_PRETTY('{"a": 43}'));
create temp table test (
textjson json
);
insert into test values
('{"a": {"b": 32, "c":"hello"}, "d": 0.3443}'),
('["dog", "pig", {"a": "here"}]'),
('["pig", "dog", {"a": "there"}]'),
('{"a": "abc","b": {"b": "abc", "a": "abc"}}');
select JSON_PRETTY(textjson) from test;
insert into test values
(JSON_PRETTY('{"a": 43, "b": {"c": true}}'));
select * from test;
drop schema test_json_pretty cascade;
reset current_schema;