mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Make CaseSensitiveness an enum class
This commit is contained in:
parent
496b4c9a5c
commit
79402aa71b
@ -118,10 +118,10 @@ AggregateFunctionPtr createAggregateFunctionAnalysisOfVariance(const std::string
|
||||
void registerAggregateFunctionAnalysisOfVariance(AggregateFunctionFactory & factory)
|
||||
{
|
||||
AggregateFunctionProperties properties = { .is_order_dependent = false };
|
||||
factory.registerFunction("analysisOfVariance", {createAggregateFunctionAnalysisOfVariance, properties}, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("analysisOfVariance", {createAggregateFunctionAnalysisOfVariance, properties}, AggregateFunctionFactory::Case::Insensitive);
|
||||
|
||||
/// This is widely used term
|
||||
factory.registerAlias("anova", "analysisOfVariance", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("anova", "analysisOfVariance", AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -361,9 +361,9 @@ void registerAggregateFunctionsAny(AggregateFunctionFactory & factory)
|
||||
AggregateFunctionProperties default_properties = {.returns_default_when_only_null = false, .is_order_dependent = true};
|
||||
|
||||
factory.registerFunction("any", {createAggregateFunctionAny, default_properties});
|
||||
factory.registerAlias("any_value", "any", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("first_value", "any", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("any_value", "any", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("first_value", "any", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction("anyLast", {createAggregateFunctionAnyLast, default_properties});
|
||||
factory.registerAlias("last_value", "anyLast", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("last_value", "anyLast", AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
}
|
||||
|
@ -221,11 +221,11 @@ void registerAggregateFunctionsAnyRespectNulls(AggregateFunctionFactory & factor
|
||||
= {.returns_default_when_only_null = false, .is_order_dependent = true, .is_window_function = true};
|
||||
|
||||
factory.registerFunction("any_respect_nulls", {createAggregateFunctionAnyRespectNulls, default_properties_for_respect_nulls});
|
||||
factory.registerAlias("any_value_respect_nulls", "any_respect_nulls", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("first_value_respect_nulls", "any_respect_nulls", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("any_value_respect_nulls", "any_respect_nulls", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("first_value_respect_nulls", "any_respect_nulls", AggregateFunctionFactory::Case::Insensitive);
|
||||
|
||||
factory.registerFunction("anyLast_respect_nulls", {createAggregateFunctionAnyLastRespectNulls, default_properties_for_respect_nulls});
|
||||
factory.registerAlias("last_value_respect_nulls", "anyLast_respect_nulls", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("last_value_respect_nulls", "anyLast_respect_nulls", AggregateFunctionFactory::Case::Insensitive);
|
||||
|
||||
/// Must happen after registering any and anyLast
|
||||
factory.registerNullsActionTransformation("any", "any_respect_nulls");
|
||||
|
@ -46,6 +46,6 @@ AggregateFunctionPtr createAggregateFunctionAvg(const std::string & name, const
|
||||
|
||||
void registerAggregateFunctionAvg(AggregateFunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction("avg", createAggregateFunctionAvg, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("avg", createAggregateFunctionAvg, AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
}
|
||||
|
@ -234,9 +234,9 @@ void registerAggregateFunctionsBitwise(AggregateFunctionFactory & factory)
|
||||
factory.registerFunction("groupBitXor", createAggregateFunctionBitwise<AggregateFunctionGroupBitXorData>);
|
||||
|
||||
/// Aliases for compatibility with MySQL.
|
||||
factory.registerAlias("BIT_OR", "groupBitOr", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("BIT_AND", "groupBitAnd", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("BIT_XOR", "groupBitXor", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("BIT_OR", "groupBitOr", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("BIT_AND", "groupBitAnd", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("BIT_XOR", "groupBitXor", AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ template <typename T1, typename T2> using AggregateFunctionCorr = AggregateFunct
|
||||
|
||||
void registerAggregateFunctionsStatisticsCorr(AggregateFunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction("corr", createAggregateFunctionStatisticsBinary<AggregateFunctionCorr, StatisticsFunctionKind::corr>, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("corr", createAggregateFunctionStatisticsBinary<AggregateFunctionCorr, StatisticsFunctionKind::corr>, AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ AggregateFunctionPtr createAggregateFunctionCount(const std::string & name, cons
|
||||
void registerAggregateFunctionCount(AggregateFunctionFactory & factory)
|
||||
{
|
||||
AggregateFunctionProperties properties = { .returns_default_when_only_null = true, .is_order_dependent = false };
|
||||
factory.registerFunction("count", {createAggregateFunctionCount, properties}, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("count", {createAggregateFunctionCount, properties}, AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ void registerAggregateFunctionsStatisticsCovar(AggregateFunctionFactory & factor
|
||||
factory.registerFunction("covarPop", createAggregateFunctionStatisticsBinary<AggregateFunctionCovar, StatisticsFunctionKind::covarPop>);
|
||||
|
||||
/// Synonyms for compatibility.
|
||||
factory.registerAlias("COVAR_SAMP", "covarSamp", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("COVAR_POP", "covarPop", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("COVAR_SAMP", "covarSamp", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("COVAR_POP", "covarPop", AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ const String & getAggregateFunctionCanonicalNameIfAny(const String & name)
|
||||
return AggregateFunctionFactory::instance().getCanonicalNameIfAny(name);
|
||||
}
|
||||
|
||||
void AggregateFunctionFactory::registerFunction(const String & name, Value creator_with_properties, CaseSensitiveness case_sensitiveness)
|
||||
void AggregateFunctionFactory::registerFunction(const String & name, Value creator_with_properties, Case case_sensitiveness)
|
||||
{
|
||||
if (creator_with_properties.creator == nullptr)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "AggregateFunctionFactory: "
|
||||
@ -39,7 +39,7 @@ void AggregateFunctionFactory::registerFunction(const String & name, Value creat
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "AggregateFunctionFactory: the aggregate function name '{}' is not unique",
|
||||
name);
|
||||
|
||||
if (case_sensitiveness == CaseInsensitive)
|
||||
if (case_sensitiveness == Case::Insensitive)
|
||||
{
|
||||
auto key = Poco::toLower(name);
|
||||
if (!case_insensitive_aggregate_functions.emplace(key, creator_with_properties).second)
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
void registerFunction(
|
||||
const String & name,
|
||||
Value creator,
|
||||
CaseSensitiveness case_sensitiveness = CaseSensitive);
|
||||
Case case_sensitiveness = Case::Sensitive);
|
||||
|
||||
/// Register how to transform from one aggregate function to other based on NullsAction
|
||||
/// Registers them both ways:
|
||||
|
@ -840,8 +840,8 @@ void registerAggregateFunctionGroupArray(AggregateFunctionFactory & factory)
|
||||
AggregateFunctionProperties properties = { .returns_default_when_only_null = false, .is_order_dependent = true };
|
||||
|
||||
factory.registerFunction("groupArray", { createAggregateFunctionGroupArray<false>, properties });
|
||||
factory.registerAlias("array_agg", "groupArray", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAliasUnchecked("array_concat_agg", "groupArrayArray", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("array_agg", "groupArray", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAliasUnchecked("array_concat_agg", "groupArrayArray", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction("groupArraySample", { createAggregateFunctionGroupArraySample, properties });
|
||||
factory.registerFunction("groupArrayLast", { createAggregateFunctionGroupArray<true>, properties });
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ void registerAggregateFunctionGroupConcat(AggregateFunctionFactory & factory)
|
||||
AggregateFunctionProperties properties = { .returns_default_when_only_null = false, .is_order_dependent = true };
|
||||
|
||||
factory.registerFunction("groupConcat", { createAggregateFunctionGroupConcat, properties });
|
||||
factory.registerAlias("group_concat", "groupConcat", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("group_concat", "groupConcat", AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ AggregateFunctionPtr createAggregateFunctionKolmogorovSmirnovTest(
|
||||
|
||||
void registerAggregateFunctionKolmogorovSmirnovTest(AggregateFunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction("kolmogorovSmirnovTest", createAggregateFunctionKolmogorovSmirnovTest, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("kolmogorovSmirnovTest", createAggregateFunctionKolmogorovSmirnovTest, AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,11 +15,11 @@ void registerAggregateFunctionsStatisticsSecondMoment(AggregateFunctionFactory &
|
||||
factory.registerFunction("stddevPop", createAggregateFunctionStatisticsUnary<AggregateFunctionSecondMoment, StatisticsFunctionKind::stddevPop>);
|
||||
|
||||
/// Synonyms for compatibility.
|
||||
factory.registerAlias("VAR_SAMP", "varSamp", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("VAR_POP", "varPop", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("STDDEV_SAMP", "stddevSamp", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("STDDEV_POP", "stddevPop", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("STD", "stddevPop", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("VAR_SAMP", "varSamp", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("VAR_POP", "varPop", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("STDDEV_SAMP", "stddevSamp", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("STDDEV_POP", "stddevPop", AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("STD", "stddevPop", AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ AggregateFunctionPtr createAggregateFunctionSum(const std::string & name, const
|
||||
|
||||
void registerAggregateFunctionSum(AggregateFunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction("sum", createAggregateFunctionSum<AggregateFunctionSumSimple>, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("sum", createAggregateFunctionSum<AggregateFunctionSumSimple>, AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction("sumWithOverflow", createAggregateFunctionSum<AggregateFunctionSumWithOverflow>);
|
||||
factory.registerFunction("sumKahan", createAggregateFunctionSum<AggregateFunctionSumKahan>);
|
||||
}
|
||||
|
@ -535,9 +535,9 @@ void registerAggregateFunctionTopK(AggregateFunctionFactory & factory)
|
||||
|
||||
factory.registerFunction("topK", { createAggregateFunctionTopK<false, false>, properties });
|
||||
factory.registerFunction("topKWeighted", { createAggregateFunctionTopK<true, false>, properties });
|
||||
factory.registerFunction("approx_top_k", { createAggregateFunctionTopK<false, true>, properties }, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("approx_top_sum", { createAggregateFunctionTopK<true, true>, properties }, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("approx_top_count", "approx_top_k", AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("approx_top_k", { createAggregateFunctionTopK<false, true>, properties }, AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction("approx_top_sum", { createAggregateFunctionTopK<true, true>, properties }, AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("approx_top_count", "approx_top_k", AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -195,8 +195,8 @@ AggregateFunctionPtr createAggregateFunctionMinMax(
|
||||
|
||||
void registerAggregateFunctionsMinMax(AggregateFunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction("min", createAggregateFunctionMinMax<true>, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("max", createAggregateFunctionMinMax<false>, AggregateFunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("min", createAggregateFunctionMinMax<true>, AggregateFunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction("max", createAggregateFunctionMinMax<false>, AggregateFunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -39,16 +39,16 @@ protected:
|
||||
|
||||
public:
|
||||
/// For compatibility with SQL, it's possible to specify that certain function name is case insensitive.
|
||||
enum CaseSensitiveness
|
||||
enum Case
|
||||
{
|
||||
CaseSensitive,
|
||||
CaseInsensitive
|
||||
Sensitive,
|
||||
Insensitive
|
||||
};
|
||||
|
||||
/** Register additional name for value
|
||||
* real_name have to be already registered.
|
||||
*/
|
||||
void registerAlias(const String & alias_name, const String & real_name, CaseSensitiveness case_sensitiveness = CaseSensitive)
|
||||
void registerAlias(const String & alias_name, const String & real_name, Case case_sensitiveness = Sensitive)
|
||||
{
|
||||
const auto & creator_map = getMap();
|
||||
const auto & case_insensitive_creator_map = getCaseInsensitiveMap();
|
||||
@ -66,12 +66,12 @@ public:
|
||||
}
|
||||
|
||||
/// We need sure the real_name exactly exists when call the function directly.
|
||||
void registerAliasUnchecked(const String & alias_name, const String & real_name, CaseSensitiveness case_sensitiveness = CaseSensitive)
|
||||
void registerAliasUnchecked(const String & alias_name, const String & real_name, Case case_sensitiveness = Sensitive)
|
||||
{
|
||||
String alias_name_lowercase = Poco::toLower(alias_name);
|
||||
const String factory_name = getFactoryName();
|
||||
|
||||
if (case_sensitiveness == CaseInsensitive)
|
||||
if (case_sensitiveness == Insensitive)
|
||||
{
|
||||
if (!case_insensitive_aliases.emplace(alias_name_lowercase, real_name).second)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "{}: case insensitive alias name '{}' is not unique", factory_name, alias_name);
|
||||
|
@ -17,7 +17,7 @@ SerializationPtr DataTypeDate::doGetDefaultSerialization() const
|
||||
|
||||
void registerDataTypeDate(DataTypeFactory & factory)
|
||||
{
|
||||
factory.registerSimpleDataType("Date", [] { return DataTypePtr(std::make_shared<DataTypeDate>()); }, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerSimpleDataType("Date", [] { return DataTypePtr(std::make_shared<DataTypeDate>()); }, DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ Field DataTypeDate32::getDefault() const
|
||||
void registerDataTypeDate32(DataTypeFactory & factory)
|
||||
{
|
||||
factory.registerSimpleDataType(
|
||||
"Date32", [] { return DataTypePtr(std::make_shared<DataTypeDate32>()); }, DataTypeFactory::CaseInsensitive);
|
||||
"Date32", [] { return DataTypePtr(std::make_shared<DataTypeDate32>()); }, DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ void registerDataTypeDomainBool(DataTypeFactory & factory)
|
||||
std::make_unique<DataTypeCustomFixedName>("Bool"), std::make_unique<SerializationBool>(type->getDefaultSerialization())));
|
||||
});
|
||||
|
||||
factory.registerAlias("bool", "Bool", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("boolean", "Bool", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("bool", "Bool", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("boolean", "Bool", DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ void registerDataTypeEnum(DataTypeFactory & factory)
|
||||
factory.registerDataType("Enum", create);
|
||||
|
||||
/// MySQL
|
||||
factory.registerAlias("ENUM", "Enum", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("ENUM", "Enum", DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ DataTypePtr DataTypeFactory::getCustom(DataTypeCustomDescPtr customization) cons
|
||||
}
|
||||
|
||||
|
||||
void DataTypeFactory::registerDataType(const String & family_name, Value creator, CaseSensitiveness case_sensitiveness)
|
||||
void DataTypeFactory::registerDataType(const String & family_name, Value creator, Case case_sensitiveness)
|
||||
{
|
||||
if (creator == nullptr)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "DataTypeFactory: the data type family {} has been provided a null constructor", family_name);
|
||||
@ -189,12 +189,12 @@ void DataTypeFactory::registerDataType(const String & family_name, Value creator
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "DataTypeFactory: the data type family name '{}' is not unique",
|
||||
family_name);
|
||||
|
||||
if (case_sensitiveness == CaseInsensitive
|
||||
if (case_sensitiveness == Case::Insensitive
|
||||
&& !case_insensitive_data_types.emplace(family_name_lowercase, creator).second)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "DataTypeFactory: the case insensitive data type family name '{}' is not unique", family_name);
|
||||
}
|
||||
|
||||
void DataTypeFactory::registerSimpleDataType(const String & name, SimpleCreator creator, CaseSensitiveness case_sensitiveness)
|
||||
void DataTypeFactory::registerSimpleDataType(const String & name, SimpleCreator creator, Case case_sensitiveness)
|
||||
{
|
||||
if (creator == nullptr)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "DataTypeFactory: the data type {} has been provided a null constructor",
|
||||
@ -208,7 +208,7 @@ void DataTypeFactory::registerSimpleDataType(const String & name, SimpleCreator
|
||||
}, case_sensitiveness);
|
||||
}
|
||||
|
||||
void DataTypeFactory::registerDataTypeCustom(const String & family_name, CreatorWithCustom creator, CaseSensitiveness case_sensitiveness)
|
||||
void DataTypeFactory::registerDataTypeCustom(const String & family_name, CreatorWithCustom creator, Case case_sensitiveness)
|
||||
{
|
||||
registerDataType(family_name, [creator](const ASTPtr & ast)
|
||||
{
|
||||
@ -219,7 +219,7 @@ void DataTypeFactory::registerDataTypeCustom(const String & family_name, Creator
|
||||
}, case_sensitiveness);
|
||||
}
|
||||
|
||||
void DataTypeFactory::registerSimpleDataTypeCustom(const String & name, SimpleCreatorWithCustom creator, CaseSensitiveness case_sensitiveness)
|
||||
void DataTypeFactory::registerSimpleDataTypeCustom(const String & name, SimpleCreatorWithCustom creator, Case case_sensitiveness)
|
||||
{
|
||||
registerDataTypeCustom(name, [name, creator](const ASTPtr & ast)
|
||||
{
|
||||
|
@ -41,16 +41,16 @@ public:
|
||||
DataTypePtr tryGet(const ASTPtr & ast) const;
|
||||
|
||||
/// Register a type family by its name.
|
||||
void registerDataType(const String & family_name, Value creator, CaseSensitiveness case_sensitiveness = CaseSensitive);
|
||||
void registerDataType(const String & family_name, Value creator, Case case_sensitiveness = Case::Sensitive);
|
||||
|
||||
/// Register a simple data type, that have no parameters.
|
||||
void registerSimpleDataType(const String & name, SimpleCreator creator, CaseSensitiveness case_sensitiveness = CaseSensitive);
|
||||
void registerSimpleDataType(const String & name, SimpleCreator creator, Case case_sensitiveness = Case::Sensitive);
|
||||
|
||||
/// Register a customized type family
|
||||
void registerDataTypeCustom(const String & family_name, CreatorWithCustom creator, CaseSensitiveness case_sensitiveness = CaseSensitive);
|
||||
void registerDataTypeCustom(const String & family_name, CreatorWithCustom creator, Case case_sensitiveness = Case::Sensitive);
|
||||
|
||||
/// Register a simple customized data type
|
||||
void registerSimpleDataTypeCustom(const String & name, SimpleCreatorWithCustom creator, CaseSensitiveness case_sensitiveness = CaseSensitive);
|
||||
void registerSimpleDataTypeCustom(const String & name, SimpleCreatorWithCustom creator, Case case_sensitiveness = Case::Sensitive);
|
||||
|
||||
private:
|
||||
template <bool nullptr_on_error>
|
||||
|
@ -64,7 +64,7 @@ void registerDataTypeFixedString(DataTypeFactory & factory)
|
||||
factory.registerDataType("FixedString", create);
|
||||
|
||||
/// Compatibility alias.
|
||||
factory.registerAlias("BINARY", "FixedString", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BINARY", "FixedString", DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,9 +9,9 @@ namespace DB
|
||||
void registerDataTypeIPv4andIPv6(DataTypeFactory & factory)
|
||||
{
|
||||
factory.registerSimpleDataType("IPv4", [] { return DataTypePtr(std::make_shared<DataTypeIPv4>()); });
|
||||
factory.registerAlias("INET4", "IPv4", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET4", "IPv4", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerSimpleDataType("IPv6", [] { return DataTypePtr(std::make_shared<DataTypeIPv6>()); });
|
||||
factory.registerAlias("INET6", "IPv6", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET6", "IPv6", DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ void registerDataTypeObject(DataTypeFactory & factory)
|
||||
factory.registerDataType("Object", create);
|
||||
factory.registerSimpleDataType("JSON",
|
||||
[] { return std::make_shared<DataTypeObject>("JSON", false); },
|
||||
DataTypeFactory::CaseInsensitive);
|
||||
DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,38 +62,38 @@ void registerDataTypeString(DataTypeFactory & factory)
|
||||
|
||||
/// These synonims are added for compatibility.
|
||||
|
||||
factory.registerAlias("CHAR", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NCHAR", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("CHARACTER", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("VARCHAR", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NVARCHAR", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("VARCHAR2", "String", DataTypeFactory::CaseInsensitive); /// Oracle
|
||||
factory.registerAlias("TEXT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("TINYTEXT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("MEDIUMTEXT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("LONGTEXT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BLOB", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("CLOB", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("TINYBLOB", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("MEDIUMBLOB", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("LONGBLOB", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BYTEA", "String", DataTypeFactory::CaseInsensitive); /// PostgreSQL
|
||||
factory.registerAlias("CHAR", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NCHAR", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("CHARACTER", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("VARCHAR", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NVARCHAR", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("VARCHAR2", "String", DataTypeFactory::Case::Insensitive); /// Oracle
|
||||
factory.registerAlias("TEXT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("TINYTEXT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("MEDIUMTEXT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("LONGTEXT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BLOB", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("CLOB", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("TINYBLOB", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("MEDIUMBLOB", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("LONGBLOB", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BYTEA", "String", DataTypeFactory::Case::Insensitive); /// PostgreSQL
|
||||
|
||||
factory.registerAlias("CHARACTER LARGE OBJECT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("CHARACTER VARYING", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("CHAR LARGE OBJECT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("CHAR VARYING", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NATIONAL CHAR", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NATIONAL CHARACTER", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NATIONAL CHARACTER LARGE OBJECT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NATIONAL CHARACTER VARYING", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NATIONAL CHAR VARYING", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NCHAR VARYING", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NCHAR LARGE OBJECT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BINARY LARGE OBJECT", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BINARY VARYING", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("VARBINARY", "String", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("GEOMETRY", "String", DataTypeFactory::CaseInsensitive); //mysql
|
||||
factory.registerAlias("CHARACTER LARGE OBJECT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("CHARACTER VARYING", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("CHAR LARGE OBJECT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("CHAR VARYING", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NATIONAL CHAR", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NATIONAL CHARACTER", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NATIONAL CHARACTER LARGE OBJECT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NATIONAL CHARACTER VARYING", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NATIONAL CHAR VARYING", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NCHAR VARYING", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NCHAR LARGE OBJECT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BINARY LARGE OBJECT", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BINARY VARYING", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("VARBINARY", "String", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("GEOMETRY", "String", DataTypeFactory::Case::Insensitive); //mysql
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -364,15 +364,15 @@ template class DataTypeDecimal<Decimal256>;
|
||||
|
||||
void registerDataTypeDecimal(DataTypeFactory & factory)
|
||||
{
|
||||
factory.registerDataType("Decimal32", createExact<Decimal32>, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerDataType("Decimal64", createExact<Decimal64>, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerDataType("Decimal128", createExact<Decimal128>, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerDataType("Decimal256", createExact<Decimal256>, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerDataType("Decimal32", createExact<Decimal32>, DataTypeFactory::Case::Insensitive);
|
||||
factory.registerDataType("Decimal64", createExact<Decimal64>, DataTypeFactory::Case::Insensitive);
|
||||
factory.registerDataType("Decimal128", createExact<Decimal128>, DataTypeFactory::Case::Insensitive);
|
||||
factory.registerDataType("Decimal256", createExact<Decimal256>, DataTypeFactory::Case::Insensitive);
|
||||
|
||||
factory.registerDataType("Decimal", create, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("DEC", "Decimal", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("NUMERIC", "Decimal", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("FIXED", "Decimal", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerDataType("Decimal", create, DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("DEC", "Decimal", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("NUMERIC", "Decimal", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("FIXED", "Decimal", DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -65,41 +65,41 @@ void registerDataTypeNumbers(DataTypeFactory & factory)
|
||||
|
||||
/// These synonyms are added for compatibility.
|
||||
|
||||
factory.registerAlias("TINYINT", "Int8", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INT1", "Int8", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BYTE", "Int8", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("TINYINT SIGNED", "Int8", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INT1 SIGNED", "Int8", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("SMALLINT", "Int16", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("SMALLINT SIGNED", "Int16", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INT", "Int32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INTEGER", "Int32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("MEDIUMINT", "Int32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("MEDIUMINT SIGNED", "Int32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INT SIGNED", "Int32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INTEGER SIGNED", "Int32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BIGINT", "Int64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("SIGNED", "Int64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BIGINT SIGNED", "Int64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("TIME", "Int64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("TINYINT", "Int8", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INT1", "Int8", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BYTE", "Int8", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("TINYINT SIGNED", "Int8", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INT1 SIGNED", "Int8", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("SMALLINT", "Int16", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("SMALLINT SIGNED", "Int16", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INT", "Int32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INTEGER", "Int32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("MEDIUMINT", "Int32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("MEDIUMINT SIGNED", "Int32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INT SIGNED", "Int32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INTEGER SIGNED", "Int32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BIGINT", "Int64", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("SIGNED", "Int64", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BIGINT SIGNED", "Int64", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("TIME", "Int64", DataTypeFactory::Case::Insensitive);
|
||||
|
||||
factory.registerAlias("TINYINT UNSIGNED", "UInt8", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INT1 UNSIGNED", "UInt8", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("SMALLINT UNSIGNED", "UInt16", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("YEAR", "UInt16", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("MEDIUMINT UNSIGNED", "UInt32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INT UNSIGNED", "UInt32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("INTEGER UNSIGNED", "UInt32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("UNSIGNED", "UInt64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BIGINT UNSIGNED", "UInt64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("BIT", "UInt64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("SET", "UInt64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("TINYINT UNSIGNED", "UInt8", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INT1 UNSIGNED", "UInt8", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("SMALLINT UNSIGNED", "UInt16", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("YEAR", "UInt16", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("MEDIUMINT UNSIGNED", "UInt32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INT UNSIGNED", "UInt32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("INTEGER UNSIGNED", "UInt32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("UNSIGNED", "UInt64", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BIGINT UNSIGNED", "UInt64", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("BIT", "UInt64", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("SET", "UInt64", DataTypeFactory::Case::Insensitive);
|
||||
|
||||
factory.registerAlias("FLOAT", "Float32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("REAL", "Float32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("SINGLE", "Float32", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("DOUBLE", "Float64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("DOUBLE PRECISION", "Float64", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("FLOAT", "Float32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("REAL", "Float32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("SINGLE", "Float32", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("DOUBLE", "Float64", DataTypeFactory::Case::Insensitive);
|
||||
factory.registerAlias("DOUBLE PRECISION", "Float64", DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
/// Explicit template instantiations.
|
||||
|
@ -108,11 +108,11 @@ static DataTypePtr create64(const ASTPtr & arguments)
|
||||
|
||||
void registerDataTypeDateTime(DataTypeFactory & factory)
|
||||
{
|
||||
factory.registerDataType("DateTime", create, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerDataType("DateTime32", create32, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerDataType("DateTime64", create64, DataTypeFactory::CaseInsensitive);
|
||||
factory.registerDataType("DateTime", create, DataTypeFactory::Case::Insensitive);
|
||||
factory.registerDataType("DateTime32", create32, DataTypeFactory::Case::Insensitive);
|
||||
factory.registerDataType("DateTime64", create64, DataTypeFactory::Case::Insensitive);
|
||||
|
||||
factory.registerAlias("TIMESTAMP", "DateTime", DataTypeFactory::CaseInsensitive);
|
||||
factory.registerAlias("TIMESTAMP", "DateTime", DataTypeFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -150,9 +150,9 @@ using FunctionCRC64ECMA = FunctionCRC<CRC64ECMAImpl>;
|
||||
|
||||
REGISTER_FUNCTION(CRC)
|
||||
{
|
||||
factory.registerFunction<FunctionCRC32ZLib>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionCRC32IEEE>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionCRC64ECMA>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionCRC32ZLib>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<FunctionCRC32IEEE>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<FunctionCRC64ECMA>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -137,10 +137,10 @@ FunctionOverloadResolverPtr createInternalCastOverloadResolver(CastType type, st
|
||||
|
||||
REGISTER_FUNCTION(CastOverloadResolvers)
|
||||
{
|
||||
factory.registerFunction("_CAST", [](ContextPtr context){ return CastOverloadResolverImpl::create(context, CastType::nonAccurate, true, {}); }, {}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("_CAST", [](ContextPtr context){ return CastOverloadResolverImpl::create(context, CastType::nonAccurate, true, {}); }, {}, FunctionFactory::Case::Insensitive);
|
||||
/// Note: "internal" (not affected by null preserving setting) versions of accurate cast functions are unneeded.
|
||||
|
||||
factory.registerFunction("CAST", [](ContextPtr context){ return CastOverloadResolverImpl::create(context, CastType::nonAccurate, false, {}); }, {}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("CAST", [](ContextPtr context){ return CastOverloadResolverImpl::create(context, CastType::nonAccurate, false, {}); }, {}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction("accurateCast", [](ContextPtr context){ return CastOverloadResolverImpl::create(context, CastType::accurate, false, {}); }, {});
|
||||
factory.registerFunction("accurateCastOrNull", [](ContextPtr context){ return CastOverloadResolverImpl::create(context, CastType::accurateOrNull, false, {}); }, {});
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ private:
|
||||
|
||||
REGISTER_FUNCTION(Char)
|
||||
{
|
||||
factory.registerFunction<FunctionChar>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionChar>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
|
||||
REGISTER_FUNCTION(FQDN)
|
||||
{
|
||||
factory.registerFunction<FunctionFQDN>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionFQDN>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("fullHostName", "FQDN");
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ void FunctionFactory::registerFunction(
|
||||
const std::string & name,
|
||||
FunctionCreator creator,
|
||||
FunctionDocumentation doc,
|
||||
CaseSensitiveness case_sensitiveness)
|
||||
Case case_sensitiveness)
|
||||
{
|
||||
if (!functions.emplace(name, FunctionFactoryData{creator, doc}).second)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "FunctionFactory: the function name '{}' is not unique", name);
|
||||
@ -41,7 +41,7 @@ void FunctionFactory::registerFunction(
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "FunctionFactory: the function name '{}' is already registered as alias",
|
||||
name);
|
||||
|
||||
if (case_sensitiveness == CaseInsensitive)
|
||||
if (case_sensitiveness == Case::Insensitive)
|
||||
{
|
||||
if (!case_insensitive_functions.emplace(function_name_lowercase, FunctionFactoryData{creator, doc}).second)
|
||||
throw Exception(ErrorCodes::LOGICAL_ERROR, "FunctionFactory: the case insensitive function name '{}' is not unique",
|
||||
@ -54,7 +54,7 @@ void FunctionFactory::registerFunction(
|
||||
const std::string & name,
|
||||
FunctionSimpleCreator creator,
|
||||
FunctionDocumentation doc,
|
||||
CaseSensitiveness case_sensitiveness)
|
||||
Case case_sensitiveness)
|
||||
{
|
||||
registerFunction(name, [my_creator = std::move(creator)](ContextPtr context)
|
||||
{
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
static FunctionFactory & instance();
|
||||
|
||||
template <typename Function>
|
||||
void registerFunction(FunctionDocumentation doc = {}, CaseSensitiveness case_sensitiveness = CaseSensitive)
|
||||
void registerFunction(FunctionDocumentation doc = {}, Case case_sensitiveness = Case::Sensitive)
|
||||
{
|
||||
registerFunction<Function>(Function::name, std::move(doc), case_sensitiveness);
|
||||
}
|
||||
@ -56,13 +56,13 @@ public:
|
||||
const std::string & name,
|
||||
FunctionCreator creator,
|
||||
FunctionDocumentation doc = {},
|
||||
CaseSensitiveness case_sensitiveness = CaseSensitive);
|
||||
Case case_sensitiveness = Case::Sensitive);
|
||||
|
||||
void registerFunction(
|
||||
const std::string & name,
|
||||
FunctionSimpleCreator creator,
|
||||
FunctionDocumentation doc = {},
|
||||
CaseSensitiveness case_sensitiveness = CaseSensitive);
|
||||
Case case_sensitiveness = Case::Sensitive);
|
||||
|
||||
FunctionDocumentation getDocumentation(const std::string & name) const;
|
||||
|
||||
@ -79,7 +79,7 @@ private:
|
||||
String getFactoryName() const override { return "FunctionFactory"; }
|
||||
|
||||
template <typename Function>
|
||||
void registerFunction(const std::string & name, FunctionDocumentation doc = {}, CaseSensitiveness case_sensitiveness = CaseSensitive)
|
||||
void registerFunction(const std::string & name, FunctionDocumentation doc = {}, Case case_sensitiveness = Case::Sensitive)
|
||||
{
|
||||
registerFunction(name, &Function::create, std::move(doc), case_sensitiveness);
|
||||
}
|
||||
|
@ -445,8 +445,7 @@ The function returns a value of type String.
|
||||
{"with specified seed", "SELECT generateRandomStructure(1, 42)", "c1 UInt128"},
|
||||
},
|
||||
.categories{"Random"}
|
||||
},
|
||||
FunctionFactory::CaseSensitive);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -728,10 +728,10 @@ public:
|
||||
|
||||
REGISTER_FUNCTION(BinaryRepr)
|
||||
{
|
||||
factory.registerFunction<EncodeToBinaryRepresentation<HexImpl>>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<DecodeFromBinaryRepresentation<UnhexImpl>>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<EncodeToBinaryRepresentation<BinImpl>>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<DecodeFromBinaryRepresentation<UnbinImpl>>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<EncodeToBinaryRepresentation<HexImpl>>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<DecodeFromBinaryRepresentation<UnhexImpl>>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<EncodeToBinaryRepresentation<BinImpl>>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<DecodeFromBinaryRepresentation<UnbinImpl>>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1169,10 +1169,10 @@ REGISTER_FUNCTION(Coding)
|
||||
factory.registerFunction<FunctionIPv6StringToNum<IPStringToNumExceptionMode::Null>>();
|
||||
|
||||
/// MySQL compatibility aliases:
|
||||
factory.registerAlias("INET_ATON", FunctionIPv4StringToNum<IPStringToNumExceptionMode::Throw>::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET6_NTOA", FunctionIPv6NumToString::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET6_ATON", FunctionIPv6StringToNum<IPStringToNumExceptionMode::Throw>::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET_NTOA", NameFunctionIPv4NumToString::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET_ATON", FunctionIPv4StringToNum<IPStringToNumExceptionMode::Throw>::name, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("INET6_NTOA", FunctionIPv6NumToString::name, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("INET6_ATON", FunctionIPv6StringToNum<IPStringToNumExceptionMode::Throw>::name, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("INET_NTOA", NameFunctionIPv4NumToString::name, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -180,8 +180,7 @@ An optional second argument can be passed to specify a timezone for the timestam
|
||||
{"ulid", "SELECT ULIDStringToDateTime(generateULID())", ""},
|
||||
{"timezone", "SELECT ULIDStringToDateTime(generateULID(), 'Asia/Istanbul')", ""}},
|
||||
.categories{"ULID"}
|
||||
},
|
||||
FunctionFactory::CaseSensitive);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -496,8 +496,8 @@ This function accepts a UUID and returns a FixedString(16) as its binary represe
|
||||
│ 612f3c40-5d3b-217e-707b-6a546a3d7b29 │ a/<@];!~p{jTj={) │ @</a];!~p{jTj={) │
|
||||
└──────────────────────────────────────┴──────────────────┴──────────────────┘
|
||||
)"}},
|
||||
.categories{"UUID"}},
|
||||
FunctionFactory::CaseSensitive);
|
||||
.categories{"UUID"}});
|
||||
|
||||
|
||||
factory.registerFunction<FunctionUUIDv7ToDateTime>(
|
||||
FunctionDocumentation{
|
||||
@ -509,8 +509,7 @@ An optional second argument can be passed to specify a timezone for the timestam
|
||||
.examples{
|
||||
{"uuid","select UUIDv7ToDateTime(generateUUIDv7())", ""},
|
||||
{"uuid","select generateUUIDv7() as uuid, UUIDv7ToDateTime(uuid), UUIDv7ToDateTime(uuid, 'America/New_York')", ""}},
|
||||
.categories{"UUID"}},
|
||||
FunctionFactory::CaseSensitive);
|
||||
.categories{"UUID"}});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5224,7 +5224,7 @@ REGISTER_FUNCTION(Conversion)
|
||||
/// MySQL compatibility alias. Cannot be registered as alias,
|
||||
/// because we don't want it to be normalized to toDate in queries,
|
||||
/// otherwise CREATE DICTIONARY query breaks.
|
||||
factory.registerFunction("DATE", &FunctionToDate::create, {}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction("DATE", &FunctionToDate::create, {}, FunctionFactory::Case::Insensitive);
|
||||
|
||||
factory.registerFunction<FunctionToDate32>();
|
||||
factory.registerFunction<FunctionToDateTime>();
|
||||
|
@ -41,8 +41,7 @@ REGISTER_FUNCTION(Hashing)
|
||||
.description="Calculates value of XXH3 64-bit hash function. Refer to https://github.com/Cyan4973/xxHash for detailed documentation.",
|
||||
.examples{{"hash", "SELECT xxh3('ClickHouse')", ""}},
|
||||
.categories{"Hash"}
|
||||
},
|
||||
FunctionFactory::CaseSensitive);
|
||||
});
|
||||
|
||||
factory.registerFunction<FunctionWyHash64>();
|
||||
|
||||
|
@ -29,7 +29,7 @@ REGISTER_FUNCTION(Logical)
|
||||
factory.registerFunction<FunctionAnd>();
|
||||
factory.registerFunction<FunctionOr>();
|
||||
factory.registerFunction<FunctionXor>();
|
||||
factory.registerFunction<FunctionNot>({}, FunctionFactory::CaseInsensitive); /// Operator NOT(x) can be parsed as a function.
|
||||
factory.registerFunction<FunctionNot>({}, FunctionFactory::Case::Insensitive); /// Operator NOT(x) can be parsed as a function.
|
||||
}
|
||||
|
||||
namespace ErrorCodes
|
||||
|
@ -99,8 +99,8 @@ using FunctionSubDate = FunctionOpDate<SubDate>;
|
||||
|
||||
REGISTER_FUNCTION(AddInterval)
|
||||
{
|
||||
factory.registerFunction<FunctionAddDate>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionSubDate>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionAddDate>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<FunctionSubDate>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,16 +7,16 @@ namespace DB
|
||||
|
||||
REGISTER_FUNCTION(Round)
|
||||
{
|
||||
factory.registerFunction<FunctionRound>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionRoundBankers>({}, FunctionFactory::CaseSensitive);
|
||||
factory.registerFunction<FunctionFloor>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionCeil>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionTrunc>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionRound>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<FunctionRoundBankers>({}, FunctionFactory::Case::Sensitive);
|
||||
factory.registerFunction<FunctionFloor>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<FunctionCeil>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<FunctionTrunc>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<FunctionRoundDown>();
|
||||
|
||||
/// Compatibility aliases.
|
||||
factory.registerAlias("ceiling", "ceil", FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("truncate", "trunc", FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("ceiling", "ceil", FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("truncate", "trunc", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -428,8 +428,7 @@ REGISTER_FUNCTION(HashFixedStrings)
|
||||
It returns a BLAKE3 hash as a byte array with type FixedString(32).
|
||||
)",
|
||||
.examples{{"hash", "SELECT hex(BLAKE3('ABC'))", ""}},
|
||||
.categories{"Hash"}},
|
||||
FunctionFactory::CaseSensitive);
|
||||
.categories{"Hash"}});
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
@ -104,7 +104,7 @@ REGISTER_FUNCTION(JSONArrayLength)
|
||||
.description="Returns the number of elements in the outermost JSON array. The function returns NULL if input JSON string is invalid."});
|
||||
|
||||
/// For Spark compatibility.
|
||||
factory.registerAlias("JSON_ARRAY_LENGTH", "JSONArrayLength", FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("JSON_ARRAY_LENGTH", "JSONArrayLength", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -117,8 +117,8 @@ Example:
|
||||
)",
|
||||
.examples{
|
||||
{"typical", "SELECT UTCTimestamp();", ""}},
|
||||
.categories{"Dates and Times"}}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("UTC_timestamp", UTCTimestampOverloadResolver::name, FunctionFactory::CaseInsensitive);
|
||||
.categories{"Dates and Times"}}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("UTC_timestamp", UTCTimestampOverloadResolver::name, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -144,8 +144,8 @@ REGISTER_FUNCTION(UTCTimestampTransform)
|
||||
{
|
||||
factory.registerFunction<ToUTCTimestampFunction>();
|
||||
factory.registerFunction<FromUTCTimestampFunction>();
|
||||
factory.registerAlias("to_utc_timestamp", NameToUTCTimestamp::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("from_utc_timestamp", NameFromUTCTimestamp::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("to_utc_timestamp", NameToUTCTimestamp::name, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("from_utc_timestamp", NameFromUTCTimestamp::name, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ template <> struct FunctionUnaryArithmeticMonotonicity<NameAbs>
|
||||
|
||||
REGISTER_FUNCTION(Abs)
|
||||
{
|
||||
factory.registerFunction<FunctionAbs>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionAbs>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ using FunctionAcos = FunctionMathUnary<UnaryFunctionVectorized<AcosName, acos>>;
|
||||
|
||||
REGISTER_FUNCTION(Acos)
|
||||
{
|
||||
factory.registerFunction<FunctionAcos>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionAcos>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ private:
|
||||
REGISTER_FUNCTION(ArrayFlatten)
|
||||
{
|
||||
factory.registerFunction<ArrayFlatten>();
|
||||
factory.registerAlias("flatten", "arrayFlatten", FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("flatten", "arrayFlatten", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ It is possible to override the seed to produce stable results:
|
||||
{"explicit_seed", "SELECT arrayShuffle([1, 2, 3, 4], 41)", ""},
|
||||
{"materialize", "SELECT arrayShuffle(materialize([1, 2, 3]), 42), arrayShuffle([1, 2, 3], 42) FROM numbers(10)", ""}},
|
||||
.categories{"Array"}},
|
||||
FunctionFactory::CaseInsensitive);
|
||||
FunctionFactory::Case::Insensitive);
|
||||
|
||||
factory.registerFunction<FunctionArrayShuffleImpl<FunctionArrayPartialShuffleTraits>>(
|
||||
FunctionDocumentation{
|
||||
@ -224,7 +224,7 @@ It is possible to override the seed to produce stable results:
|
||||
{"materialize",
|
||||
"SELECT arrayPartialShuffle(materialize([1, 2, 3, 4]), 2, 42), arrayPartialShuffle([1, 2, 3], 2, 42) FROM numbers(10)", ""}},
|
||||
.categories{"Array"}},
|
||||
FunctionFactory::CaseInsensitive);
|
||||
FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -100,8 +100,8 @@ It is ok to have ASCII NUL bytes in strings, and they will be counted as well.
|
||||
},
|
||||
.categories{"String", "Array"}
|
||||
},
|
||||
FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("OCTET_LENGTH", "length", FunctionFactory::CaseInsensitive);
|
||||
FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("OCTET_LENGTH", "length", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ If s is empty, the result is 0. If the first character is not an ASCII character
|
||||
)",
|
||||
.examples{{"ascii", "SELECT ascii('234')", ""}},
|
||||
.categories{"String"}
|
||||
}, FunctionFactory::CaseInsensitive);
|
||||
}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ For more details, see [https://en.wikipedia.org/wiki/Inverse_trigonometric_funct
|
||||
{"nan", "SELECT asin(1.1), asin(-2), asin(inf), asin(nan)", ""}},
|
||||
.categories{"Mathematical", "Trigonometric"}
|
||||
},
|
||||
FunctionFactory::CaseInsensitive);
|
||||
FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ using FunctionAtan = FunctionMathUnary<UnaryFunctionVectorized<AtanName, atan>>;
|
||||
|
||||
REGISTER_FUNCTION(Atan)
|
||||
{
|
||||
factory.registerFunction<FunctionAtan>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionAtan>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace
|
||||
|
||||
REGISTER_FUNCTION(Atan2)
|
||||
{
|
||||
factory.registerFunction<FunctionAtan2>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionAtan2>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ REGISTER_FUNCTION(Base64Decode)
|
||||
factory.registerFunction<FunctionBase64Conversion<Base64Decode<Base64Variant::Normal>>>({description, syntax, arguments, returned_value, examples, categories});
|
||||
|
||||
/// MySQL compatibility alias.
|
||||
factory.registerAlias("FROM_BASE64", "base64Decode", FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("FROM_BASE64", "base64Decode", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ REGISTER_FUNCTION(Base64Encode)
|
||||
factory.registerFunction<FunctionBase64Conversion<Base64Encode<Base64Variant::Normal>>>({description, syntax, arguments, returned_value, examples, categories});
|
||||
|
||||
/// MySQL compatibility alias.
|
||||
factory.registerAlias("TO_BASE64", "base64Encode", FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("TO_BASE64", "base64Encode", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ One use-case of this function is reversing IPv4s:
|
||||
{"64-bit", "SELECT byteSwap(123294967295)", "18439412204227788800"},
|
||||
},
|
||||
.categories{"Mathematical", "Arithmetic"}},
|
||||
FunctionFactory::CaseInsensitive);
|
||||
FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ private:
|
||||
|
||||
REGISTER_FUNCTION(Coalesce)
|
||||
{
|
||||
factory.registerFunction<FunctionCoalesce>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionCoalesce>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ private:
|
||||
|
||||
REGISTER_FUNCTION(Concat)
|
||||
{
|
||||
factory.registerFunction<ConcatOverloadResolver>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<ConcatOverloadResolver>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerFunction<FunctionConcatAssumeInjective>();
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,7 @@ The function is named “injective” if it always returns different result for
|
||||
.categories{"String"}});
|
||||
|
||||
/// Compatibility with Spark and MySQL:
|
||||
factory.registerAlias("concat_ws", "concatWithSeparator", FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("concat_ws", "concatWithSeparator", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,8 +33,8 @@ public:
|
||||
|
||||
REGISTER_FUNCTION(ConnectionId)
|
||||
{
|
||||
factory.registerFunction<FunctionConnectionId>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("connection_id", "connectionID", FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionConnectionId>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("connection_id", "connectionID", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ using FunctionCos = FunctionMathUnary<UnaryFunctionVectorized<CosName, cos>>;
|
||||
|
||||
REGISTER_FUNCTION(Cos)
|
||||
{
|
||||
factory.registerFunction<FunctionCos>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionCos>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,8 +22,8 @@ namespace DB
|
||||
|
||||
REGISTER_FUNCTION(CountMatches)
|
||||
{
|
||||
factory.registerFunction<FunctionCountMatches<FunctionCountMatchesCaseSensitive>>({}, FunctionFactory::CaseSensitive);
|
||||
factory.registerFunction<FunctionCountMatches<FunctionCountMatchesCaseInsensitive>>({}, FunctionFactory::CaseSensitive);
|
||||
factory.registerFunction<FunctionCountMatches<FunctionCountMatchesCaseSensitive>>();
|
||||
factory.registerFunction<FunctionCountMatches<FunctionCountMatchesCaseInsensitive>>();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,6 @@ using FunctionCountSubstrings = FunctionsStringSearch<CountSubstringsImpl<NameCo
|
||||
|
||||
REGISTER_FUNCTION(CountSubstrings)
|
||||
{
|
||||
factory.registerFunction<FunctionCountSubstrings>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionCountSubstrings>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
}
|
||||
|
@ -54,9 +54,9 @@ public:
|
||||
REGISTER_FUNCTION(CurrentDatabase)
|
||||
{
|
||||
factory.registerFunction<FunctionCurrentDatabase>();
|
||||
factory.registerAlias("DATABASE", FunctionCurrentDatabase::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("SCHEMA", FunctionCurrentDatabase::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("current_database", FunctionCurrentDatabase::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("DATABASE", FunctionCurrentDatabase::name, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("SCHEMA", FunctionCurrentDatabase::name, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("current_database", FunctionCurrentDatabase::name, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ Requires a boolean parameter, but it is ignored actually. It is required just fo
|
||||
{"common", "SELECT current_schemas(true);", "['default']"}
|
||||
}
|
||||
},
|
||||
FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("current_schemas", FunctionCurrentSchemas::name, FunctionFactory::CaseInsensitive);
|
||||
FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("current_schemas", FunctionCurrentSchemas::name, FunctionFactory::Case::Insensitive);
|
||||
|
||||
}
|
||||
|
||||
|
@ -54,8 +54,8 @@ public:
|
||||
REGISTER_FUNCTION(CurrentUser)
|
||||
{
|
||||
factory.registerFunction<FunctionCurrentUser>();
|
||||
factory.registerAlias("user", FunctionCurrentUser::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("current_user", FunctionCurrentUser::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("user", FunctionCurrentUser::name, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("current_user", FunctionCurrentUser::name, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -490,7 +490,7 @@ private:
|
||||
|
||||
REGISTER_FUNCTION(DateDiff)
|
||||
{
|
||||
factory.registerFunction<FunctionDateDiff<true>>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionDateDiff<true>>({}, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("date_diff", FunctionDateDiff<true>::name);
|
||||
factory.registerAlias("DATE_DIFF", FunctionDateDiff<true>::name);
|
||||
factory.registerAlias("timestampDiff", FunctionDateDiff<true>::name);
|
||||
@ -509,12 +509,12 @@ Example:
|
||||
)",
|
||||
.examples{
|
||||
{"typical", "SELECT timeDiff(UTCTimestamp(), now());", ""}},
|
||||
.categories{"Dates and Times"}}, FunctionFactory::CaseInsensitive);
|
||||
.categories{"Dates and Times"}}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
REGISTER_FUNCTION(Age)
|
||||
{
|
||||
factory.registerFunction<FunctionDateDiff<false>>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionDateDiff<false>>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ private:
|
||||
|
||||
REGISTER_FUNCTION(DateName)
|
||||
{
|
||||
factory.registerFunction<FunctionDateNameImpl>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionDateNameImpl>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ REGISTER_FUNCTION(DateTrunc)
|
||||
factory.registerFunction<FunctionDateTrunc>();
|
||||
|
||||
/// Compatibility alias.
|
||||
factory.registerAlias("DATE_TRUNC", "dateTrunc", FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("DATE_TRUNC", "dateTrunc", FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ namespace
|
||||
|
||||
REGISTER_FUNCTION(Degrees)
|
||||
{
|
||||
factory.registerFunction<FunctionDegrees>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionDegrees>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ using FunctionExp = FunctionMathUnary<UnaryFunctionVectorized<ExpName, exp>>;
|
||||
|
||||
REGISTER_FUNCTION(Exp)
|
||||
{
|
||||
factory.registerFunction<FunctionExp>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionExp>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace DB
|
||||
REGISTER_FUNCTION(ExtractAllGroupsVertical)
|
||||
{
|
||||
factory.registerFunction<FunctionExtractAllGroups<VerticalImpl>>();
|
||||
factory.registerAlias("extractAllGroups", VerticalImpl::Name, FunctionFactory::CaseSensitive);
|
||||
factory.registerAlias("extractAllGroups", VerticalImpl::Name);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ The factorial of 0 is 1. Likewise, the factorial() function returns 1 for any ne
|
||||
)",
|
||||
.examples{{"factorial", "SELECT factorial(10)", ""}},
|
||||
.categories{"Mathematical"}},
|
||||
FunctionFactory::CaseInsensitive);
|
||||
FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1834,10 +1834,10 @@ using FunctionFromUnixTimestampInJodaSyntax = FunctionFormatDateTimeImpl<NameFro
|
||||
REGISTER_FUNCTION(FormatDateTime)
|
||||
{
|
||||
factory.registerFunction<FunctionFormatDateTime>();
|
||||
factory.registerAlias("DATE_FORMAT", FunctionFormatDateTime::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("DATE_FORMAT", FunctionFormatDateTime::name, FunctionFactory::Case::Insensitive);
|
||||
|
||||
factory.registerFunction<FunctionFromUnixTimestamp>();
|
||||
factory.registerAlias("FROM_UNIXTIME", FunctionFromUnixTimestamp::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("FROM_UNIXTIME", FunctionFromUnixTimestamp::name, FunctionFactory::Case::Insensitive);
|
||||
|
||||
factory.registerFunction<FunctionFormatDateTimeInJodaSyntax>();
|
||||
factory.registerFunction<FunctionFromUnixTimestampInJodaSyntax>();
|
||||
|
@ -29,8 +29,7 @@ Accepts the size (number of bytes). Returns a rounded size with a suffix (KB, MB
|
||||
.examples{
|
||||
{"formatReadableDecimalSize", "SELECT formatReadableDecimalSize(1000)", ""}},
|
||||
.categories{"OtherFunctions"}
|
||||
},
|
||||
FunctionFactory::CaseSensitive);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace
|
||||
REGISTER_FUNCTION(FormatReadableSize)
|
||||
{
|
||||
factory.registerFunction<FunctionFormatReadable<Impl>>();
|
||||
factory.registerAlias("FORMAT_BYTES", Impl::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("FORMAT_BYTES", Impl::name, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ The calculation is the same as in MySQL's FROM_DAYS() function.
|
||||
.examples{{"typical", "SELECT fromDaysSinceYearZero32(713569)", "2023-09-08"}},
|
||||
.categories{"Dates and Times"}});
|
||||
|
||||
factory.registerAlias("FROM_DAYS", FunctionFromDaysSinceYearZero<DateTraits>::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("FROM_DAYS", FunctionFromDaysSinceYearZero<DateTraits>::name, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -85,8 +85,7 @@ The function returns a value of type FixedString(26).
|
||||
{"ulid", "SELECT generateULID()", ""},
|
||||
{"multiple", "SELECT generateULID(1), generateULID(2)", ""}},
|
||||
.categories{"ULID"}
|
||||
},
|
||||
FunctionFactory::CaseSensitive);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ using FunctionGreatest = FunctionBinaryArithmetic<GreatestImpl, NameGreatest>;
|
||||
|
||||
REGISTER_FUNCTION(Greatest)
|
||||
{
|
||||
factory.registerFunction<LeastGreatestOverloadResolver<LeastGreatest::Greatest, FunctionGreatest>>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<LeastGreatestOverloadResolver<LeastGreatest::Greatest, FunctionGreatest>>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ using FunctionHasSubsequence = HasSubsequenceImpl<NameHasSubsequence, HasSubsequ
|
||||
|
||||
REGISTER_FUNCTION(hasSubsequence)
|
||||
{
|
||||
factory.registerFunction<FunctionHasSubsequence>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionHasSubsequence>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ using FunctionHasSubsequenceCaseInsensitive = HasSubsequenceImpl<NameHasSubseque
|
||||
|
||||
REGISTER_FUNCTION(hasSubsequenceCaseInsensitive)
|
||||
{
|
||||
factory.registerFunction<FunctionHasSubsequenceCaseInsensitive>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionHasSubsequenceCaseInsensitive>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ using FunctionHasSubsequenceCaseInsensitiveUTF8 = HasSubsequenceImpl<NameHasSubs
|
||||
|
||||
REGISTER_FUNCTION(hasSubsequenceCaseInsensitiveUTF8)
|
||||
{
|
||||
factory.registerFunction<FunctionHasSubsequenceCaseInsensitiveUTF8>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionHasSubsequenceCaseInsensitiveUTF8>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ using FunctionHasSubsequenceUTF8 = HasSubsequenceImpl<NameHasSubsequenceUTF8, Ha
|
||||
|
||||
REGISTER_FUNCTION(hasSubsequenceUTF8)
|
||||
{
|
||||
factory.registerFunction<FunctionHasSubsequenceUTF8>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionHasSubsequenceUTF8>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,10 +25,10 @@ using FunctionHasTokenOrNull
|
||||
REGISTER_FUNCTION(HasToken)
|
||||
{
|
||||
factory.registerFunction<FunctionHasToken>(FunctionDocumentation
|
||||
{.description="Performs lookup of needle in haystack using tokenbf_v1 index."}, FunctionFactory::CaseSensitive);
|
||||
{.description="Performs lookup of needle in haystack using tokenbf_v1 index."});
|
||||
|
||||
factory.registerFunction<FunctionHasTokenOrNull>(FunctionDocumentation
|
||||
{.description="Performs lookup of needle in haystack using tokenbf_v1 index. Returns null if needle is ill-formed."}, FunctionFactory::CaseSensitive);
|
||||
{.description="Performs lookup of needle in haystack using tokenbf_v1 index. Returns null if needle is ill-formed."});
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,11 +26,11 @@ REGISTER_FUNCTION(HasTokenCaseInsensitive)
|
||||
{
|
||||
factory.registerFunction<FunctionHasTokenCaseInsensitive>(
|
||||
FunctionDocumentation{.description="Performs case insensitive lookup of needle in haystack using tokenbf_v1 index."},
|
||||
DB::FunctionFactory::CaseInsensitive);
|
||||
DB::FunctionFactory::Case::Insensitive);
|
||||
|
||||
factory.registerFunction<FunctionHasTokenCaseInsensitiveOrNull>(
|
||||
FunctionDocumentation{.description="Performs case insensitive lookup of needle in haystack using tokenbf_v1 index. Returns null if needle is ill-formed."},
|
||||
DB::FunctionFactory::CaseInsensitive);
|
||||
DB::FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ namespace
|
||||
|
||||
REGISTER_FUNCTION(Hypot)
|
||||
{
|
||||
factory.registerFunction<FunctionHypot>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionHypot>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1309,7 +1309,7 @@ public:
|
||||
|
||||
REGISTER_FUNCTION(If)
|
||||
{
|
||||
factory.registerFunction<FunctionIf>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionIf>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
FunctionOverloadResolverPtr createInternalFunctionIfOverloadResolver(bool allow_experimental_variant_type, bool use_variant_as_common_type)
|
||||
|
@ -91,7 +91,7 @@ private:
|
||||
|
||||
REGISTER_FUNCTION(IfNull)
|
||||
{
|
||||
factory.registerFunction<FunctionIfNull>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionIfNull>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ using FunctionInitcap = FunctionStringToString<InitcapImpl, NameInitcap>;
|
||||
|
||||
REGISTER_FUNCTION(Initcap)
|
||||
{
|
||||
factory.registerFunction<FunctionInitcap>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionInitcap>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,6 +41,6 @@ public:
|
||||
REGISTER_FUNCTION(InitialQueryID)
|
||||
{
|
||||
factory.registerFunction<FunctionInitialQueryID>();
|
||||
factory.registerAlias("initial_query_id", FunctionInitialQueryID::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("initial_query_id", FunctionInitialQueryID::name, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ public:
|
||||
|
||||
REGISTER_FUNCTION(IsNull)
|
||||
{
|
||||
factory.registerFunction<FunctionIsNull>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<FunctionIsNull>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ REGISTER_FUNCTION(ExtractKeyValuePairs)
|
||||
└──────────────────┘
|
||||
```)"}
|
||||
);
|
||||
factory.registerAlias("str_to_map", NameExtractKeyValuePairs::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("str_to_map", NameExtractKeyValuePairs::name, FunctionFactory::Case::Insensitive);
|
||||
factory.registerAlias("mapFromString", NameExtractKeyValuePairs::name);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ using FunctionLeast = FunctionBinaryArithmetic<LeastImpl, NameLeast>;
|
||||
|
||||
REGISTER_FUNCTION(Least)
|
||||
{
|
||||
factory.registerFunction<LeastGreatestOverloadResolver<LeastGreatest::Least, FunctionLeast>>({}, FunctionFactory::CaseInsensitive);
|
||||
factory.registerFunction<LeastGreatestOverloadResolver<LeastGreatest::Least, FunctionLeast>>({}, FunctionFactory::Case::Insensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user