mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #69189 from ClickHouse/backport/24.8/69150
Backport #69150 to 24.8: Don't create Object type if use_json_alias_for_old_object_type=1 but allow_experimental_object_type=0
This commit is contained in:
commit
bdaeb71faf
@ -517,10 +517,10 @@ static DataTypePtr createJSON(const ASTPtr & arguments)
|
|||||||
if (!context)
|
if (!context)
|
||||||
context = Context::getGlobalContextInstance();
|
context = Context::getGlobalContextInstance();
|
||||||
|
|
||||||
if (context->getSettingsRef().use_json_alias_for_old_object_type)
|
if (context->getSettingsRef().allow_experimental_object_type && context->getSettingsRef().use_json_alias_for_old_object_type)
|
||||||
{
|
{
|
||||||
if (arguments && !arguments->children.empty())
|
if (arguments && !arguments->children.empty())
|
||||||
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Experimental Object type doesn't support any arguments. If you want to use new JSON type, set setting allow_experimental_json_type = 1");
|
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Experimental Object type doesn't support any arguments. If you want to use new JSON type, set settings allow_experimental_json_type = 1 and use_json_alias_for_old_object_type = 0");
|
||||||
|
|
||||||
return std::make_shared<DataTypeObjectDeprecated>("JSON", false);
|
return std::make_shared<DataTypeObjectDeprecated>("JSON", false);
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
{"a":"42"} JSON
|
{"a":"42"} JSON
|
||||||
{"a":42} Object(\'json\')
|
{"a":42} Object(\'json\')
|
||||||
|
{"a":"42"} JSON
|
||||||
|
@ -6,3 +6,6 @@ set use_json_alias_for_old_object_type=1;
|
|||||||
select '{"a" : 42}'::JSON as json, toTypeName(json);
|
select '{"a" : 42}'::JSON as json, toTypeName(json);
|
||||||
select '{"a" : 42}'::JSON(max_dynamic_paths=100) as json, toTypeName(json); -- {serverError BAD_ARGUMENTS}
|
select '{"a" : 42}'::JSON(max_dynamic_paths=100) as json, toTypeName(json); -- {serverError BAD_ARGUMENTS}
|
||||||
|
|
||||||
|
set allow_experimental_object_type = 0;
|
||||||
|
select materialize('{"a" : 42}')::JSON as json, toTypeName(json);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user