2020-07-16 22:01:08 +00:00
|
|
|
#include <Core/SettingsEnums.h>
|
2023-06-21 13:25:10 +00:00
|
|
|
#include <magic_enum.hpp>
|
2020-07-16 22:01:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2023-06-21 13:25:10 +00:00
|
|
|
|
2020-07-16 22:01:08 +00:00
|
|
|
namespace ErrorCodes
|
|
|
|
{
|
|
|
|
extern const int UNKNOWN_LOAD_BALANCING;
|
|
|
|
extern const int UNKNOWN_OVERFLOW_MODE;
|
|
|
|
extern const int UNKNOWN_TOTALS_MODE;
|
|
|
|
extern const int UNKNOWN_DISTRIBUTED_PRODUCT_MODE;
|
|
|
|
extern const int UNKNOWN_JOIN;
|
|
|
|
extern const int BAD_ARGUMENTS;
|
2020-09-09 12:18:02 +00:00
|
|
|
extern const int UNKNOWN_MYSQL_DATATYPES_SUPPORT_LEVEL;
|
2020-10-24 13:18:04 +00:00
|
|
|
extern const int UNKNOWN_UNION;
|
2020-07-16 22:01:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(LoadBalancing, ErrorCodes::UNKNOWN_LOAD_BALANCING,
|
|
|
|
{{"random", LoadBalancing::RANDOM},
|
|
|
|
{"nearest_hostname", LoadBalancing::NEAREST_HOSTNAME},
|
2023-09-27 02:46:39 +00:00
|
|
|
{"hostname_levenshtein_distance", LoadBalancing::HOSTNAME_LEVENSHTEIN_DISTANCE},
|
2020-07-16 22:01:08 +00:00
|
|
|
{"in_order", LoadBalancing::IN_ORDER},
|
|
|
|
{"first_or_random", LoadBalancing::FIRST_OR_RANDOM},
|
|
|
|
{"round_robin", LoadBalancing::ROUND_ROBIN}})
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(JoinStrictness, ErrorCodes::UNKNOWN_JOIN,
|
|
|
|
{{"", JoinStrictness::Unspecified},
|
2022-07-29 16:30:50 +00:00
|
|
|
{"ALL", JoinStrictness::All},
|
|
|
|
{"ANY", JoinStrictness::Any}})
|
2020-07-16 22:01:08 +00:00
|
|
|
|
|
|
|
|
2022-03-17 12:51:44 +00:00
|
|
|
IMPLEMENT_SETTING_MULTI_ENUM(JoinAlgorithm, ErrorCodes::UNKNOWN_JOIN,
|
2022-07-15 14:57:58 +00:00
|
|
|
{{"default", JoinAlgorithm::DEFAULT},
|
|
|
|
{"auto", JoinAlgorithm::AUTO},
|
2020-07-16 22:01:08 +00:00
|
|
|
{"hash", JoinAlgorithm::HASH},
|
|
|
|
{"partial_merge", JoinAlgorithm::PARTIAL_MERGE},
|
2022-04-20 11:47:16 +00:00
|
|
|
{"prefer_partial_merge", JoinAlgorithm::PREFER_PARTIAL_MERGE},
|
2022-06-16 12:09:23 +00:00
|
|
|
{"parallel_hash", JoinAlgorithm::PARALLEL_HASH},
|
2022-03-30 10:07:09 +00:00
|
|
|
{"direct", JoinAlgorithm::DIRECT},
|
2022-09-07 08:00:14 +00:00
|
|
|
{"full_sorting_merge", JoinAlgorithm::FULL_SORTING_MERGE},
|
2022-06-16 12:09:23 +00:00
|
|
|
{"grace_hash", JoinAlgorithm::GRACE_HASH}})
|
2020-07-16 22:01:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(TotalsMode, ErrorCodes::UNKNOWN_TOTALS_MODE,
|
|
|
|
{{"before_having", TotalsMode::BEFORE_HAVING},
|
|
|
|
{"after_having_exclusive", TotalsMode::AFTER_HAVING_EXCLUSIVE},
|
|
|
|
{"after_having_inclusive", TotalsMode::AFTER_HAVING_INCLUSIVE},
|
|
|
|
{"after_having_auto", TotalsMode::AFTER_HAVING_AUTO}})
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(OverflowMode, ErrorCodes::UNKNOWN_OVERFLOW_MODE,
|
|
|
|
{{"throw", OverflowMode::THROW},
|
|
|
|
{"break", OverflowMode::BREAK}})
|
|
|
|
|
|
|
|
|
2023-06-21 13:25:10 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(OverflowModeGroupBy, ErrorCodes::UNKNOWN_OVERFLOW_MODE,
|
2020-07-16 22:01:08 +00:00
|
|
|
{{"throw", OverflowMode::THROW},
|
|
|
|
{"break", OverflowMode::BREAK},
|
|
|
|
{"any", OverflowMode::ANY}})
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(DistributedProductMode, ErrorCodes::UNKNOWN_DISTRIBUTED_PRODUCT_MODE,
|
|
|
|
{{"deny", DistributedProductMode::DENY},
|
|
|
|
{"local", DistributedProductMode::LOCAL},
|
|
|
|
{"global", DistributedProductMode::GLOBAL},
|
|
|
|
{"allow", DistributedProductMode::ALLOW}})
|
|
|
|
|
|
|
|
|
2023-11-09 14:00:02 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(QueryCacheNondeterministicFunctionHandling, ErrorCodes::BAD_ARGUMENTS,
|
2023-11-09 14:28:42 +00:00
|
|
|
{{"throw", QueryCacheNondeterministicFunctionHandling::Throw},
|
|
|
|
{"save", QueryCacheNondeterministicFunctionHandling::Save},
|
2023-11-09 14:00:02 +00:00
|
|
|
{"ignore", QueryCacheNondeterministicFunctionHandling::Ignore}})
|
|
|
|
|
|
|
|
|
2023-06-21 13:25:10 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(DateTimeInputFormat, ErrorCodes::BAD_ARGUMENTS,
|
2020-07-16 22:01:08 +00:00
|
|
|
{{"basic", FormatSettings::DateTimeInputFormat::Basic},
|
2022-03-02 08:00:06 +00:00
|
|
|
{"best_effort", FormatSettings::DateTimeInputFormat::BestEffort},
|
|
|
|
{"best_effort_us", FormatSettings::DateTimeInputFormat::BestEffortUS}})
|
2020-07-16 22:01:08 +00:00
|
|
|
|
|
|
|
|
2023-06-21 13:25:10 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(DateTimeOutputFormat, ErrorCodes::BAD_ARGUMENTS,
|
2020-10-13 10:59:43 +00:00
|
|
|
{{"simple", FormatSettings::DateTimeOutputFormat::Simple},
|
|
|
|
{"iso", FormatSettings::DateTimeOutputFormat::ISO},
|
|
|
|
{"unix_timestamp", FormatSettings::DateTimeOutputFormat::UnixTimestamp}})
|
|
|
|
|
2023-06-26 18:15:19 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(IntervalOutputFormat, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"kusto", FormatSettings::IntervalOutputFormat::Kusto},
|
|
|
|
{"numeric", FormatSettings::IntervalOutputFormat::Numeric}})
|
|
|
|
|
2023-06-21 13:25:10 +00:00
|
|
|
IMPLEMENT_SETTING_AUTO_ENUM(LogsLevel, ErrorCodes::BAD_ARGUMENTS)
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_AUTO_ENUM(LogQueriesType, ErrorCodes::BAD_ARGUMENTS)
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_AUTO_ENUM(DefaultDatabaseEngine, ErrorCodes::BAD_ARGUMENTS)
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_AUTO_ENUM(DefaultTableEngine, ErrorCodes::BAD_ARGUMENTS)
|
|
|
|
|
2020-09-09 12:18:02 +00:00
|
|
|
IMPLEMENT_SETTING_MULTI_ENUM(MySQLDataTypesSupport, ErrorCodes::UNKNOWN_MYSQL_DATATYPES_SUPPORT_LEVEL,
|
|
|
|
{{"decimal", MySQLDataTypesSupport::DECIMAL},
|
2022-03-09 07:58:43 +00:00
|
|
|
{"datetime64", MySQLDataTypesSupport::DATETIME64},
|
|
|
|
{"date2Date32", MySQLDataTypesSupport::DATE2DATE32},
|
|
|
|
{"date2String", MySQLDataTypesSupport::DATE2STRING}})
|
2020-09-09 12:18:02 +00:00
|
|
|
|
2022-08-30 10:09:01 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(SetOperationMode, ErrorCodes::UNKNOWN_UNION,
|
|
|
|
{{"", SetOperationMode::Unspecified},
|
|
|
|
{"ALL", SetOperationMode::ALL},
|
|
|
|
{"DISTINCT", SetOperationMode::DISTINCT}})
|
2020-10-24 13:18:04 +00:00
|
|
|
|
2021-03-08 20:35:09 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(DistributedDDLOutputMode, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"none", DistributedDDLOutputMode::NONE},
|
|
|
|
{"throw", DistributedDDLOutputMode::THROW},
|
|
|
|
{"null_status_on_timeout", DistributedDDLOutputMode::NULL_STATUS_ON_TIMEOUT},
|
|
|
|
{"never_throw", DistributedDDLOutputMode::NEVER_THROW}})
|
|
|
|
|
2023-10-10 16:21:33 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(StreamingHandleErrorMode, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"default", StreamingHandleErrorMode::DEFAULT},
|
|
|
|
{"stream", StreamingHandleErrorMode::STREAM}})
|
2021-08-16 11:30:56 +00:00
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(ShortCircuitFunctionEvaluation, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"enable", ShortCircuitFunctionEvaluation::ENABLE},
|
|
|
|
{"force_enable", ShortCircuitFunctionEvaluation::FORCE_ENABLE},
|
|
|
|
{"disable", ShortCircuitFunctionEvaluation::DISABLE}})
|
2021-10-18 10:53:42 +00:00
|
|
|
|
2022-05-20 20:08:46 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(TransactionsWaitCSNMode, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"async", TransactionsWaitCSNMode::ASYNC},
|
|
|
|
{"wait", TransactionsWaitCSNMode::WAIT},
|
|
|
|
{"wait_unknown", TransactionsWaitCSNMode::WAIT_UNKNOWN}})
|
|
|
|
|
2023-05-10 18:39:38 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(CapnProtoEnumComparingMode, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"by_names", FormatSettings::CapnProtoEnumComparingMode::BY_NAMES},
|
|
|
|
{"by_values", FormatSettings::CapnProtoEnumComparingMode::BY_VALUES},
|
|
|
|
{"by_names_case_insensitive", FormatSettings::CapnProtoEnumComparingMode::BY_NAMES_CASE_INSENSITIVE}})
|
2021-10-21 07:50:38 +00:00
|
|
|
|
2023-06-21 13:25:10 +00:00
|
|
|
IMPLEMENT_SETTING_AUTO_ENUM(EscapingRule, ErrorCodes::BAD_ARGUMENTS)
|
2022-01-27 16:54:15 +00:00
|
|
|
|
2023-03-01 21:27:46 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(MsgPackUUIDRepresentation, ErrorCodes::BAD_ARGUMENTS,
|
2022-01-27 16:54:15 +00:00
|
|
|
{{"bin", FormatSettings::MsgPackUUIDRepresentation::BIN},
|
|
|
|
{"str", FormatSettings::MsgPackUUIDRepresentation::STR},
|
|
|
|
{"ext", FormatSettings::MsgPackUUIDRepresentation::EXT}})
|
|
|
|
|
2022-08-17 13:03:41 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(Dialect, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"clickhouse", Dialect::clickhouse},
|
2023-07-20 10:54:42 +00:00
|
|
|
{"kusto", Dialect::kusto},
|
|
|
|
{"prql", Dialect::prql}})
|
2023-01-10 12:28:13 +00:00
|
|
|
|
|
|
|
|
2023-01-16 10:11:21 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(ParallelReplicasCustomKeyFilterType, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"default", ParallelReplicasCustomKeyFilterType::DEFAULT},
|
|
|
|
{"range", ParallelReplicasCustomKeyFilterType::RANGE}})
|
|
|
|
|
2023-06-21 13:25:10 +00:00
|
|
|
IMPLEMENT_SETTING_AUTO_ENUM(LocalFSReadMethod, ErrorCodes::BAD_ARGUMENTS)
|
2023-02-23 16:14:10 +00:00
|
|
|
|
2023-06-21 13:25:10 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(ParquetVersion, ErrorCodes::BAD_ARGUMENTS,
|
2023-02-27 18:00:40 +00:00
|
|
|
{{"1.0", FormatSettings::ParquetVersion::V1_0},
|
|
|
|
{"2.4", FormatSettings::ParquetVersion::V2_4},
|
|
|
|
{"2.6", FormatSettings::ParquetVersion::V2_6},
|
|
|
|
{"2.latest", FormatSettings::ParquetVersion::V2_LATEST}})
|
2023-02-23 16:14:10 +00:00
|
|
|
|
2023-03-01 21:27:46 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(ParquetCompression, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"none", FormatSettings::ParquetCompression::NONE},
|
|
|
|
{"snappy", FormatSettings::ParquetCompression::SNAPPY},
|
|
|
|
{"zstd", FormatSettings::ParquetCompression::ZSTD},
|
|
|
|
{"gzip", FormatSettings::ParquetCompression::GZIP},
|
|
|
|
{"lz4", FormatSettings::ParquetCompression::LZ4},
|
|
|
|
{"brotli", FormatSettings::ParquetCompression::BROTLI}})
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(ArrowCompression, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"none", FormatSettings::ArrowCompression::NONE},
|
|
|
|
{"lz4_frame", FormatSettings::ArrowCompression::LZ4_FRAME},
|
|
|
|
{"zstd", FormatSettings::ArrowCompression::ZSTD}})
|
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(ORCCompression, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"none", FormatSettings::ORCCompression::NONE},
|
|
|
|
{"snappy", FormatSettings::ORCCompression::SNAPPY},
|
|
|
|
{"zstd", FormatSettings::ORCCompression::ZSTD},
|
|
|
|
{"zlib", FormatSettings::ORCCompression::ZLIB},
|
|
|
|
{"lz4", FormatSettings::ORCCompression::LZ4}})
|
|
|
|
|
2023-04-29 15:48:37 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(S3QueueMode, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"ordered", S3QueueMode::ORDERED},
|
|
|
|
{"unordered", S3QueueMode::UNORDERED}})
|
|
|
|
|
2023-05-01 05:23:33 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(S3QueueAction, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"keep", S3QueueAction::KEEP},
|
|
|
|
{"delete", S3QueueAction::DELETE}})
|
2022-11-14 08:59:53 +00:00
|
|
|
|
|
|
|
IMPLEMENT_SETTING_ENUM(ExternalCommandStderrReaction, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"none", ExternalCommandStderrReaction::NONE},
|
|
|
|
{"log", ExternalCommandStderrReaction::LOG},
|
2023-08-11 14:53:55 +00:00
|
|
|
{"log_first", ExternalCommandStderrReaction::LOG_FIRST},
|
|
|
|
{"log_last", ExternalCommandStderrReaction::LOG_LAST},
|
2022-11-14 08:59:53 +00:00
|
|
|
{"throw", ExternalCommandStderrReaction::THROW}})
|
2023-08-05 15:13:16 +00:00
|
|
|
|
2023-10-20 20:46:41 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(SchemaInferenceMode, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"default", SchemaInferenceMode::DEFAULT},
|
|
|
|
{"union", SchemaInferenceMode::UNION}})
|
|
|
|
|
2023-10-27 12:53:58 +00:00
|
|
|
IMPLEMENT_SETTING_ENUM(DateTimeOverflowBehavior, ErrorCodes::BAD_ARGUMENTS,
|
|
|
|
{{"throw", FormatSettings::DateTimeOverflowBehavior::Throw},
|
|
|
|
{"ignore", FormatSettings::DateTimeOverflowBehavior::Ignore},
|
|
|
|
{"saturate", FormatSettings::DateTimeOverflowBehavior::Saturate}})
|
2020-07-16 22:01:08 +00:00
|
|
|
}
|