mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
support Bool in JSONType
This commit is contained in:
parent
fc1e0608c6
commit
2c41ddf609
@ -647,11 +647,12 @@ public:
|
||||
case ElementType::OBJECT:
|
||||
type = '{';
|
||||
break;
|
||||
case ElementType::BOOL:
|
||||
type = 'b';
|
||||
break;
|
||||
case ElementType::NULL_VALUE:
|
||||
type = 0;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
ColumnVector<Int8> & col_vec = assert_cast<ColumnVector<Int8> &>(dest);
|
||||
|
@ -19,6 +19,7 @@ a
|
||||
--JSONType--
|
||||
Object
|
||||
Array
|
||||
Bool
|
||||
--JSONExtract<numeric>--
|
||||
-100
|
||||
200
|
||||
@ -172,6 +173,7 @@ a
|
||||
--JSONType--
|
||||
Object
|
||||
Array
|
||||
Bool
|
||||
--JSONExtract<numeric>--
|
||||
-100
|
||||
200
|
||||
|
@ -28,6 +28,7 @@ SELECT JSONKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2);
|
||||
SELECT '--JSONType--';
|
||||
SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}');
|
||||
SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
|
||||
SELECT JSONType('{"a": true}', 'a');
|
||||
|
||||
SELECT '--JSONExtract<numeric>--';
|
||||
SELECT JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1);
|
||||
@ -196,6 +197,7 @@ SELECT JSONKey('{"a": "hello", "b": [-100, 200.0, 300]}', -2);
|
||||
SELECT '--JSONType--';
|
||||
SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}');
|
||||
SELECT JSONType('{"a": "hello", "b": [-100, 200.0, 300]}', 'b');
|
||||
SELECT JSONType('{"a": true}', 'a');
|
||||
|
||||
SELECT '--JSONExtract<numeric>--';
|
||||
SELECT JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1);
|
||||
|
Loading…
Reference in New Issue
Block a user