ClickHouse Case-Insensitive UTF-8 Subsequence Function (Functions/hasSubsequenceCaseInsensitiveUTF8.cpp)

ClickHouse · src/Functions/hasSubsequenceCaseInsensitiveUTF8.cpp · cpp · Apache-2.0
database, tag:unicode, tag:utf8

Provides a ClickHouse SQL function for searching UTF-8 strings case-insensitively for subsequences. Reuse when extending database text search capabilities.

// Source: https://github.com/ClickHouse/ClickHouse | License: Apache-2.0 | Copyright 2016-2026 ClickHouse, Inc
// Provided via justclaw.it.com; keep this notice with the code.
#include <Functions/FunctionFactory.h>
#include <Functions/HasSubsequenceImpl.h>

#include <Poco/Unicode.h>

namespace DB
{
namespace
{

struct HasSubsequenceCaseInsensitiveUTF8
{
    static constexpr bool is_utf8 = true;

    static int toLowerIfNeed(int code_point) { return Poco::Unicode::toLower(code_point); }
};

struct NameHasSubsequenceCaseInsensitiveUTF8
{
    static constexpr auto name = "hasSubsequenceCaseInsensitiveUTF8";
};

using FunctionHasSubsequenceCaseInsensitiveUTF8 = HasSubsequenceImpl<NameHasSubsequenceCaseInsensitiveUTF8, HasSubsequenceCaseInsensitiveUTF8>;
}

REGISTER_FUNCTION(hasSubsequenceCase

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key