ClickHouse/tests/queries/0_stateless/02568_json_array_length.reference

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
641 B
Plaintext
Raw Normal View History

2023-02-21 03:08:13 +00:00
-- { echoOn }
2023-02-21 04:31:02 +00:00
select JSONArrayLength(null);
2023-02-21 03:08:13 +00:00
\N
2023-02-21 04:31:02 +00:00
select JSONArrayLength('');
2023-02-21 03:08:13 +00:00
\N
2023-02-21 04:31:02 +00:00
select JSONArrayLength('[]');
2023-02-21 03:08:13 +00:00
0
2023-02-21 04:31:02 +00:00
select JSONArrayLength('[1,2,3]');
2023-02-21 03:08:13 +00:00
3
2023-02-21 04:31:02 +00:00
select JSONArrayLength('[[1,2],[5,6,7]]');
2023-02-21 03:08:13 +00:00
2
2023-02-21 04:31:02 +00:00
select JSONArrayLength('[{"a":123},{"b":"hello"}]');
2023-02-21 03:08:13 +00:00
2
2023-02-21 04:31:02 +00:00
select JSONArrayLength('[1,2,3,[33,44],{"key":[2,3,4]}]');
2023-02-21 03:08:13 +00:00
5
2023-02-21 04:31:02 +00:00
select JSONArrayLength('{"key":"not a json array"}');
2023-02-21 03:08:13 +00:00
\N
2023-02-21 04:31:02 +00:00
select JSONArrayLength('[1,2,3,4,5');
2023-02-21 03:08:13 +00:00
\N
2023-02-21 04:31:02 +00:00
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 }