ClickHouse/tests/queries/0_stateless/02568_json_array_length.reference
2023-02-27 19:44:37 +00:00

26 lines
641 B
Plaintext

-- { echoOn }
select JSONArrayLength(null);
\N
select JSONArrayLength('');
\N
select JSONArrayLength('[]');
0
select JSONArrayLength('[1,2,3]');
3
select JSONArrayLength('[[1,2],[5,6,7]]');
2
select JSONArrayLength('[{"a":123},{"b":"hello"}]');
2
select JSONArrayLength('[1,2,3,[33,44],{"key":[2,3,4]}]');
5
select JSONArrayLength('{"key":"not a json array"}');
\N
select JSONArrayLength('[1,2,3,4,5');
\N
select JSON_ARRAY_LENGTH('[1,2,3,4,5');
\N
select JSON_ARRAY_LENGTH('[1,2,3,4,5]');
5
select JSONArrayLength(2); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
select JSONArrayLength(); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }