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