Skip to content

Commit f1b2dba

Browse files
authored
Merge pull request #60353 from Avogar/validate-nested-types-under-a-setting
Validate experimental and suspicious types inside nested types under a setting
2 parents 2e4de1f + 3c881b6 commit f1b2dba

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

src/Core/Settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,7 @@ class IColumn;
11651165
M(Bool, dictionary_use_async_executor, false, "Execute a pipeline for reading dictionary source in several threads. It's supported only by dictionaries with local CLICKHOUSE source.", 0) \
11661166
M(Bool, precise_float_parsing, false, "Prefer more precise (but slower) float parsing algorithm", 0) \
11671167
M(DateTimeOverflowBehavior, date_time_overflow_behavior, "ignore", "Overflow mode for Date, Date32, DateTime, DateTime64 types. Possible values: 'ignore', 'throw', 'saturate'.", 0) \
1168+
M(Bool, validate_experimental_and_suspicious_types_inside_nested_types, true, "Validate usage of experimental and suspicious types inside nested types like Array/Map/Tuple", 0) \
11681169

11691170

11701171
// End of FORMAT_FACTORY_SETTINGS

src/Core/SettingsChangesHistory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ namespace SettingsChangesHistory
8686
static std::map<ClickHouseVersion, SettingsChangesHistory::SettingsChanges> settings_changes_history =
8787
{
8888
{"24.2", {
89+
{"validate_experimental_and_suspicious_types_inside_nested_types", false, true, "Validate usage of experimental and suspicious types inside nested types"},
8990
{"output_format_values_escape_quote_with_quote", false, false, "If true escape ' with '', otherwise quoted with \\'"},
9091
{"input_format_try_infer_exponent_floats", true, false, "Don't infer floats in exponential notation by default"},
9192
{"query_plan_optimize_prewhere", true, true, "Allow to push down filter to PREWHERE expression for supported storages"},

src/Interpreters/parseColumnsListForTableFunction.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ void validateDataType(const DataTypePtr & type_to_check, const DataTypeValidatio
7676
};
7777

7878
validate_callback(*type_to_check);
79-
type_to_check->forEachChild(validate_callback);
79+
if (settings.validate_nested_types)
80+
type_to_check->forEachChild(validate_callback);
8081
}
8182

8283
ColumnsDescription parseColumnsListFromString(const std::string & structure, const ContextPtr & context)

src/Interpreters/parseColumnsListForTableFunction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ struct DataTypeValidationSettings
1919
, allow_experimental_object_type(settings.allow_experimental_object_type)
2020
, allow_suspicious_fixed_string_types(settings.allow_suspicious_fixed_string_types)
2121
, allow_experimental_variant_type(settings.allow_experimental_variant_type)
22+
, validate_nested_types(settings.validate_experimental_and_suspicious_types_inside_nested_types)
2223
{
2324
}
2425

2526
bool allow_suspicious_low_cardinality_types = true;
2627
bool allow_experimental_object_type = true;
2728
bool allow_suspicious_fixed_string_types = true;
2829
bool allow_experimental_variant_type = true;
30+
bool validate_nested_types = true;
2931
};
3032

3133
void validateDataType(const DataTypePtr & type, const DataTypeValidationSettings & settings);

0 commit comments

Comments
 (0)