2019-07-31 15:36:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-08-01 01:53:38 +00:00
|
|
|
#include <string>
|
|
|
|
#include <Storages/ColumnsDescription.h>
|
2022-12-21 21:21:30 +00:00
|
|
|
#include <Core/Settings.h>
|
2019-07-31 15:36:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2019-08-01 01:53:38 +00:00
|
|
|
|
|
|
|
class Context;
|
|
|
|
|
2022-12-21 21:21:30 +00:00
|
|
|
struct DataTypeValidationSettings
|
|
|
|
{
|
|
|
|
DataTypeValidationSettings() = default;
|
|
|
|
|
|
|
|
explicit DataTypeValidationSettings(const Settings & settings)
|
|
|
|
: allow_suspicious_low_cardinality_types(settings.allow_suspicious_low_cardinality_types)
|
|
|
|
, allow_experimental_object_type(settings.allow_experimental_object_type)
|
|
|
|
, allow_suspicious_fixed_string_types(settings.allow_suspicious_fixed_string_types)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-12-21 23:47:56 +00:00
|
|
|
bool allow_suspicious_low_cardinality_types = true;
|
|
|
|
bool allow_experimental_object_type = true;
|
|
|
|
bool allow_suspicious_fixed_string_types = true;
|
2022-12-21 21:21:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void validateDataType(const DataTypePtr & type, const DataTypeValidationSettings & settings);
|
|
|
|
|
2019-07-31 15:58:28 +00:00
|
|
|
/// Parses a common argument for table functions such as table structure given in string
|
2023-03-13 04:21:48 +00:00
|
|
|
[[nodiscard]] ColumnsDescription parseColumnsListFromString(const std::string & structure, const ContextPtr & context);
|
2019-07-31 15:36:10 +00:00
|
|
|
|
2023-02-27 15:20:56 +00:00
|
|
|
bool tryParseColumnsListFromString(const std::string & structure, ColumnsDescription & columns, const ContextPtr & context, String & error);
|
2022-01-26 13:29:33 +00:00
|
|
|
|
2019-07-31 15:36:10 +00:00
|
|
|
}
|