ClickHouse/tests/queries/0_stateless/03279_not_empty_json.sql
2024-12-03 13:15:14 +00:00

24 lines
774 B
SQL

set enable_json_type=1;
create table test (json JSON) engine=Memory;
insert into test values ('{}'), ('{"a" : 42}'), ('{"b" : {"c" : 42}}');
select json, notEmpty(json) from test;
drop table test;
create table test (json JSON(a UInt32)) engine=Memory;
insert into test values ('{}'), ('{"a" : 42}'), ('{"b" : {"c" : 42}}');
select json, notEmpty(json) from test;
drop table test;
create table test (json JSON(max_dynamic_paths=1)) engine=Memory;
insert into test values ('{}'), ('{"a" : 42}'), ('{"b" : {"c" : 42}}');
select json, notEmpty(json) from test;
drop table test;
create table test (json JSON(max_dynamic_paths=0)) engine=Memory;
insert into test values ('{}'), ('{"a" : 42}'), ('{"b" : {"c" : 42}}');
select json, notEmpty(json) from test;
drop table test;