ClickHouse/src/Functions/hasToken.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
1019 B
C++
Raw Normal View History

#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsStringSearch.h>
#include <Functions/HasTokenImpl.h>
#include <Common/Volnitsky.h>
namespace DB
2020-09-07 18:00:37 +00:00
{
2023-06-28 08:41:39 +00:00
struct NameHasToken
{
static constexpr auto name = "hasToken";
};
2023-01-23 22:27:48 +00:00
struct NameHasTokenOrNull
{
static constexpr auto name = "hasTokenOrNull";
};
using FunctionHasToken
2023-06-28 08:41:39 +00:00
= FunctionsStringSearch<HasTokenImpl<NameHasToken, Volnitsky, false>>;
using FunctionHasTokenOrNull
2023-06-28 08:41:39 +00:00
= FunctionsStringSearch<HasTokenImpl<NameHasTokenOrNull, Volnitsky, false>, ExecutionErrorPolicy::Null>;
2020-09-07 18:00:37 +00:00
REGISTER_FUNCTION(HasToken)
{
factory.registerFunction<FunctionHasToken>(FunctionDocumentation
{.description="Performs lookup of needle in haystack using tokenbf_v1 index."}, FunctionFactory::CaseSensitive);
2023-01-17 15:12:06 +00:00
factory.registerFunction<FunctionHasTokenOrNull>(FunctionDocumentation
{.description="Performs lookup of needle in haystack using tokenbf_v1 index. Returns null if needle is ill-formed."}, FunctionFactory::CaseSensitive);
}
}