String data type in Aiven for ClickHouse®#
Aiven for ClickHouse® uses ClickHouse® databases, which can store diverse types of data, such as decimals, boolean data type, or arrays. This article focuses on strings and its usage in ClickHouse. Discover key functions and data type conversions required for working efficiently with strings in ClickHouse.
About strings in ClickHouse#
ClickHouse allows strings of any length. Strings can contain an arbitrary amount of bytes, which are stored and output as-is. The string type replaces the types VARCHAR, BLOB, CLOB, and others from other database management systems (DBMS). When creating tables, numeric parameters for string fields can be set (for example, TEXT(140)) but are ignored.
ClickHouse supports the following aliases for strings: LONGTEXT, MEDIUMTEXT, TINYTEXT, TEXT, LONGBLOB, MEDIUMBLOB, TINYBLOB, BLOB, VARCHAR, CHAR.
By default, the search is case-sensitive in these functions, but case-insensitive search variants are also available.
Any plain string type can be cast to a different type using functions in Type Conversion Functions.
Strings and JSON#
ClickHouse supports a wide range of functions for working with JSON. With specific functions, you can use strings for extracting JSON.
Learn more on JSON functions in ClickHouse.
Parse the string in double quotes.
Parse a JSON and extract a string.
Convert a value of any data type to its JSON representation.