v.24.9New Feature
Added overlay and overlayUTF8 functions for string replacement in ClickHouse
Added functionsoverlayandoverlayUTF8which replace parts of a string by another string. Example:SELECT overlay('Hello New York', 'Jersey', 11)returnsHello New Jersey. #66933 (李扬).
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 callingoverlay(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.