v.23.7New Feature

Added hasSubsequence functions for string matching

Added new hasSubsequence (+CaseInsensitive and UTF8 versions) functions to match subsequences in strings. #52050 (Dmitry Kardymon).
Added new hasSubsequence functions, including case-insensitive and UTF-8 aware versions, to check if a string contains a specified subsequence.

Why it matters

These functions address the need for more flexible string matching capabilities in ClickHouse, allowing users to efficiently identify whether a string contains a given subsequence, with options for case insensitivity and proper UTF-8 handling.

How to use it

Use the hasSubsequence function in your SQL queries to check for the presence of a subsequence within a string. For case-insensitive matching, use hasSubsequenceCaseInsensitive. For UTF-8 aware matching, use hasSubsequenceUTF8 or its case-insensitive variant. Example usage:

SELECT hasSubsequence(column_name, 'subseq') FROM table_name;