v.24.9New Feature

Added overlay and overlayUTF8 functions for string replacement in ClickHouse

Added functions overlay and overlayUTF8 which replace parts of a string by another string. Example: SELECT overlay('Hello New York', 'Jersey', 11) returns Hello New Jersey. #66933 (李扬).
Introduced new functions overlay and overlayUTF8 to replace portions of a string with another string.

Why it matters

These functions solve the problem of modifying substrings within a given string by allowing users to specify the replacement string and the starting position for the replacement. This provides a convenient way to perform in-place edits on strings directly within ClickHouse queries.

How to use it

Use the functions by calling overlay(original_string, replacement_string, start_position) or overlayUTF8(original_string, replacement_string, start_position). For example:

SELECT overlay('Hello New York', 'Jersey', 11)

This returns Hello New Jersey.