mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
add allow_experimental_decimal to settings
This commit is contained in:
parent
241b05c80a
commit
74823c8c17
@ -34,6 +34,7 @@
|
||||
#include <DataTypes/DataTypeFactory.h>
|
||||
#include <DataTypes/NestedUtils.h>
|
||||
#include <DataTypes/DataTypesNumber.h>
|
||||
#include <DataTypes/DataTypesDecimal.h>
|
||||
|
||||
#include <Databases/DatabaseFactory.h>
|
||||
#include <Databases/IDatabase.h>
|
||||
@ -353,8 +354,9 @@ void InterpreterCreateQuery::checkSupportedTypes(const ColumnsDescription & colu
|
||||
{
|
||||
const auto & settings = context.getSettingsRef();
|
||||
bool allow_low_cardinality = settings.allow_experimental_low_cardinality_type != 0;
|
||||
bool allow_decimal = settings.allow_experimental_decimal;
|
||||
|
||||
if (allow_low_cardinality)
|
||||
if (allow_low_cardinality && allow_decimal)
|
||||
return;
|
||||
|
||||
auto check_types = [&](const NamesAndTypesList & list)
|
||||
@ -368,6 +370,12 @@ void InterpreterCreateQuery::checkSupportedTypes(const ColumnsDescription & colu
|
||||
+ "Set setting allow_experimental_low_cardinality_type = 1 in order to allow it.";
|
||||
throw Exception(message, ErrorCodes::ILLEGAL_COLUMN);
|
||||
}
|
||||
if (!allow_decimal && column.type && isDecimal(*column.type))
|
||||
{
|
||||
String message = "Cannot create table with column " + column.name + " which type is " + column.type->getName()
|
||||
+ ". Set setting allow_experimental_decimal = 1 in order to allow it.";
|
||||
throw Exception(message, ErrorCodes::ILLEGAL_COLUMN);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -272,6 +272,7 @@ struct Settings
|
||||
M(SettingUInt64, low_cardinality_max_dictionary_size, 8192, "Maximum size (in rows) of shared global dictionary for LowCardinality type.") \
|
||||
M(SettingBool, low_cardinality_use_single_dictionary_for_part, false, "LowCardinality type serialization setting. If is true, than will use additional keys when global dictionary overflows. Otherwise, will create several shared dictionaries.") \
|
||||
M(SettingBool, allow_experimental_low_cardinality_type, false, "Allows to create table with LowCardinality types.") \
|
||||
M(SettingBool, allow_experimental_decimal, false, "Enables Decimal data type.") \
|
||||
\
|
||||
M(SettingBool, prefer_localhost_replica, 1, "1 - always send query to local replica, if it exists. 0 - choose replica to send query between local and remote ones according to load_balancing") \
|
||||
M(SettingUInt64, max_fetch_partition_retries_count, 5, "Amount of retries while fetching partition from another host.") \
|
||||
|
@ -1,3 +1,4 @@
|
||||
SET allow_experimental_decimal=1;
|
||||
CREATE DATABASE IF NOT EXISTS test;
|
||||
DROP TABLE IF EXISTS test.decimal;
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
SET allow_experimental_decimal=1;
|
||||
CREATE DATABASE IF NOT EXISTS test;
|
||||
DROP TABLE IF EXISTS test.decimal;
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
SET allow_experimental_decimal=1;
|
||||
CREATE DATABASE IF NOT EXISTS test;
|
||||
DROP TABLE IF EXISTS test.decimal;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user