mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Slightly better JSON type parsing
This commit is contained in:
parent
d65f68f88e
commit
237a81ff8c
@ -1442,7 +1442,8 @@ public:
|
||||
auto shared_variant_discr = column_dynamic.getSharedVariantDiscriminator();
|
||||
auto insert_settings_with_no_type_conversion = insert_settings;
|
||||
insert_settings_with_no_type_conversion.allow_type_conversion = false;
|
||||
for (size_t i = 0; i != variant_info.variant_names.size(); ++i)
|
||||
auto order = SerializationVariant::getVariantsDeserializeTextOrder(assert_cast<const DataTypeVariant &>(*variant_info.variant_type).getVariants());
|
||||
for (size_t i : order)
|
||||
{
|
||||
if (i != shared_variant_discr)
|
||||
{
|
||||
|
@ -0,0 +1,3 @@
|
||||
Int64 42
|
||||
Float64 42.42
|
||||
Int64 43
|
@ -0,0 +1,8 @@
|
||||
set allow_experimental_json_type = 1;
|
||||
drop table if exists test;
|
||||
create table test (json JSON) engine=Memory;
|
||||
insert into test format JSONAsObject {"a" : 42}, {"a" : 42.42}, {"a" : 43};
|
||||
|
||||
select dynamicType(json.a), json.a from test;
|
||||
drop table test;
|
||||
|
Loading…
Reference in New Issue
Block a user