ClickHouse/src/Functions/hasToken.cpp

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

33 lines
993 B
C++
Raw Normal View History

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