mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Cosmetics: Pull out settings variable
This commit is contained in:
parent
bb7c627964
commit
2ebfd01c2e
@ -36,12 +36,12 @@ public:
|
|||||||
static constexpr auto name = Impl::name;
|
static constexpr auto name = Impl::name;
|
||||||
static FunctionPtr create(ContextPtr context)
|
static FunctionPtr create(ContextPtr context)
|
||||||
{
|
{
|
||||||
if (Impl::is_using_hyperscan && !context->getSettingsRef().allow_hyperscan)
|
const auto & settings = context->getSettingsRef();
|
||||||
throw Exception(
|
|
||||||
"Hyperscan functions are disabled, because setting 'allow_hyperscan' is set to 0", ErrorCodes::FUNCTION_NOT_ALLOWED);
|
|
||||||
|
|
||||||
return std::make_shared<FunctionsMultiStringFuzzySearch>(
|
if (Impl::is_using_hyperscan && !settings.allow_hyperscan)
|
||||||
context->getSettingsRef().max_hyperscan_regexp_length, context->getSettingsRef().max_hyperscan_regexp_total_length);
|
throw Exception("Hyperscan functions are disabled, because setting 'allow_hyperscan' is set to 0", ErrorCodes::FUNCTION_NOT_ALLOWED);
|
||||||
|
|
||||||
|
return std::make_shared<FunctionsMultiStringFuzzySearch>(settings.max_hyperscan_regexp_length, settings.max_hyperscan_regexp_total_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionsMultiStringFuzzySearch(size_t max_hyperscan_regexp_length_, size_t max_hyperscan_regexp_total_length_)
|
FunctionsMultiStringFuzzySearch(size_t max_hyperscan_regexp_length_, size_t max_hyperscan_regexp_total_length_)
|
||||||
|
@ -49,12 +49,12 @@ public:
|
|||||||
static constexpr auto name = Impl::name;
|
static constexpr auto name = Impl::name;
|
||||||
static FunctionPtr create(ContextPtr context)
|
static FunctionPtr create(ContextPtr context)
|
||||||
{
|
{
|
||||||
if (Impl::is_using_hyperscan && !context->getSettingsRef().allow_hyperscan)
|
const auto & settings = context->getSettingsRef();
|
||||||
throw Exception(
|
|
||||||
"Hyperscan functions are disabled, because setting 'allow_hyperscan' is set to 0", ErrorCodes::FUNCTION_NOT_ALLOWED);
|
|
||||||
|
|
||||||
return std::make_shared<FunctionsMultiStringSearch>(
|
if (Impl::is_using_hyperscan && !settings.allow_hyperscan)
|
||||||
context->getSettingsRef().max_hyperscan_regexp_length, context->getSettingsRef().max_hyperscan_regexp_total_length);
|
throw Exception("Hyperscan functions are disabled, because setting 'allow_hyperscan' is set to 0", ErrorCodes::FUNCTION_NOT_ALLOWED);
|
||||||
|
|
||||||
|
return std::make_shared<FunctionsMultiStringSearch>(settings.max_hyperscan_regexp_length, settings.max_hyperscan_regexp_total_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
FunctionsMultiStringSearch(size_t max_hyperscan_regexp_length_, size_t max_hyperscan_regexp_total_length_)
|
FunctionsMultiStringSearch(size_t max_hyperscan_regexp_length_, size_t max_hyperscan_regexp_total_length_)
|
||||||
|
Loading…
Reference in New Issue
Block a user