mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Add more tests for JSON functions.
This commit is contained in:
parent
6cbb52128b
commit
4ec12c3d24
@ -46,6 +46,13 @@ hello
|
||||
1
|
||||
Thursday
|
||||
Friday
|
||||
(3,5)
|
||||
(7,3)
|
||||
(5,0)
|
||||
(3,5)
|
||||
(3,0)
|
||||
(3,5)
|
||||
(3,0)
|
||||
--JSONExtractKeysAndValues--
|
||||
[('a','hello')]
|
||||
[('b',[-100,200,300])]
|
||||
@ -121,6 +128,13 @@ hello
|
||||
1
|
||||
Thursday
|
||||
Friday
|
||||
(3,5)
|
||||
(7,3)
|
||||
(5,0)
|
||||
(3,5)
|
||||
(3,0)
|
||||
(3,5)
|
||||
(3,0)
|
||||
--JSONExtractKeysAndValues--
|
||||
[('a','hello')]
|
||||
[('b',[-100,200,300])]
|
||||
|
@ -54,6 +54,13 @@ SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 4, 'Nullable(
|
||||
SELECT JSONExtract('{"passed": true}', 'passed', 'UInt8');
|
||||
SELECT JSONExtract('{"day": "Thursday"}', 'day', 'Enum8(\'Sunday\' = 0, \'Monday\' = 1, \'Tuesday\' = 2, \'Wednesday\' = 3, \'Thursday\' = 4, \'Friday\' = 5, \'Saturday\' = 6)');
|
||||
SELECT JSONExtract('{"day": 5}', 'day', 'Enum8(\'Sunday\' = 0, \'Monday\' = 1, \'Tuesday\' = 2, \'Wednesday\' = 3, \'Thursday\' = 4, \'Friday\' = 5, \'Saturday\' = 6)');
|
||||
SELECT JSONExtract('{"a":3,"b":5,"c":7}', 'Tuple(a Int, b Int)');
|
||||
SELECT JSONExtract('{"a":3,"b":5,"c":7}', 'Tuple(c Int, a Int)');
|
||||
SELECT JSONExtract('{"a":3,"b":5,"c":7}', 'Tuple(b Int, d Int)');
|
||||
SELECT JSONExtract('{"a":3,"b":5,"c":7}', 'Tuple(Int, Int)');
|
||||
SELECT JSONExtract('{"a":3}', 'Tuple(Int, Int)');
|
||||
SELECT JSONExtract('[3,5,7]', 'Tuple(Int, Int)');
|
||||
SELECT JSONExtract('[3]', 'Tuple(Int, Int)');
|
||||
|
||||
SELECT '--JSONExtractKeysAndValues--';
|
||||
SELECT JSONExtractKeysAndValues('{"a": "hello", "b": [-100, 200.0, 300]}', 'String');
|
||||
@ -138,6 +145,13 @@ SELECT JSONExtract('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 4, 'Nullable(
|
||||
SELECT JSONExtract('{"passed": true}', 'passed', 'UInt8');
|
||||
SELECT JSONExtract('{"day": "Thursday"}', 'day', 'Enum8(\'Sunday\' = 0, \'Monday\' = 1, \'Tuesday\' = 2, \'Wednesday\' = 3, \'Thursday\' = 4, \'Friday\' = 5, \'Saturday\' = 6)');
|
||||
SELECT JSONExtract('{"day": 5}', 'day', 'Enum8(\'Sunday\' = 0, \'Monday\' = 1, \'Tuesday\' = 2, \'Wednesday\' = 3, \'Thursday\' = 4, \'Friday\' = 5, \'Saturday\' = 6)');
|
||||
SELECT JSONExtract('{"a":3,"b":5,"c":7}', 'Tuple(a Int, b Int)');
|
||||
SELECT JSONExtract('{"a":3,"b":5,"c":7}', 'Tuple(c Int, a Int)');
|
||||
SELECT JSONExtract('{"a":3,"b":5,"c":7}', 'Tuple(b Int, d Int)');
|
||||
SELECT JSONExtract('{"a":3,"b":5,"c":7}', 'Tuple(Int, Int)');
|
||||
SELECT JSONExtract('{"a":3}', 'Tuple(Int, Int)');
|
||||
SELECT JSONExtract('[3,5,7]', 'Tuple(Int, Int)');
|
||||
SELECT JSONExtract('[3]', 'Tuple(Int, Int)');
|
||||
|
||||
SELECT '--JSONExtractKeysAndValues--';
|
||||
SELECT JSONExtractKeysAndValues('{"a": "hello", "b": [-100, 200.0, 300]}', 'String');
|
||||
|
Loading…
Reference in New Issue
Block a user