muscles

Scalar functions

Functions that return one value per row. Names are case-insensitive. Full-text search uses hasToken(column, text), which also has the forms searchAll and searchAny, and bm25Score, which ranks the rows.

NameOther namesArgumentsDescription
abs(x)Returns the absolute value of a number.
acos(x)Returns the arc cosine of a number.
add_daysaddDays(x, y)Adds a number of days to a date or timestamp.
add_hoursaddHours(x, y)Adds a number of hours to a date or timestamp.
add_minutesaddMinutes(x, y)Adds a number of minutes to a date or timestamp.
add_monthsaddMonths(x, y)Adds a number of months to a date or timestamp.
add_quartersaddQuarters(x, y)Adds a number of quarters to a date or timestamp.
add_secondsaddSeconds(x, y)Adds a number of seconds to a date or timestamp.
add_weeksaddWeeks(x, y)Adds a number of weeks to a date or timestamp.
add_yearsaddYears(x, y)Adds a number of years to a date or timestamp.
age(unit, x, y)Returns the number of full units that have elapsed between two dates or timestamps.
array_string_concatarrayStringConcat(x[, y])Joins the elements of an array of strings, with an optional separator.
array_with_constantarrayWithConstant(x, y)Returns an array of a given length filled with one value.
asin(x)Returns the arc sine of a number.
assume_not_nullassumeNotNull(x)Returns the value of a nullable expression as if it could not be NULL.
atan(x)Returns the arc tangent of a number.
atan2(x, y)Returns the angle in radians of the point given by its y and x coordinates.
base64_decodebase64Decode(x)Decodes a Base64 string.
base64_encodebase64Encode(x)Encodes a string as Base64.
bin(x)Returns the binary text form of a value.
bit_andbitAnd(x, y)Returns the bitwise AND of two integers.
bit_countbitCount(x)Returns the number of bits set to 1 in an integer.
bit_notbitNot(x)Returns the bitwise complement of an integer.
bit_orbitOr(x, y)Returns the bitwise OR of two integers.
bit_positions_to_arraybitPositionsToArray(x)Returns the positions of the set bits of an integer as an array.
bit_shift_leftbitShiftLeft(x, y)Shifts the bits of an integer to the left.
bit_shift_rightbitShiftRight(x, y)Shifts the bits of an integer to the right.
bit_testbitTest(x, y)Returns the value of one bit of an integer.
bit_test_allbitTestAll(x1, x2, ...)Returns 1 when all the listed bits of an integer are set.
bit_test_anybitTestAny(x1, x2, ...)Returns 1 when at least one of the listed bits of an integer is set.
bit_xorbitXor(x, y)Returns the bitwise XOR of two integers.
bitmask_to_arraybitmaskToArray(x)Returns the powers of two that make up an integer as an array.
bitmask_to_listbitmaskToList(x)Returns the powers of two that make up an integer as comma-separated text.
bm25_scorebm25Score(x, y)Returns the BM25 relevance score of a text column for the given search terms.
byte_swapbyteSwap(x)Reverses the byte order of an integer.
cast(x AS type)Converts a value to the type named after AS.
cbrt(x)Returns the cube root of a number.
ceilceiling(x[, y])Rounds a number up to the number of decimal places given as the optional second argument.
char(x1, x2, ...)Builds a string from byte values.
city_hash64cityHash64(x)Returns the CityHash 64-bit hash of a value.
coalesce(x1, x2, ...)Returns the first argument that is not NULL.
concat(x1, x2, ...)Joins its arguments into one string.
concat_with_separatorconcatWithSeparator(x1, x2, ...)Joins its arguments into one string with a separator between them.
cos(x)Returns the cosine of a number.
cosh(x)Returns the hyperbolic cosine of a number.
cosine_distancecosineDistance(x, y)Returns the cosine distance between two vectors.
count_matchescountMatches(x, y)Returns the number of matches of a regular expression in a string.
cut_fragmentcutFragment(x)Removes the fragment from a URL.
cut_query_stringcutQueryString(x)Removes the query string from a URL.
cut_query_string_and_fragmentcutQueryStringAndFragment(x)Removes the query string and the fragment from a URL.
cut_to_first_significant_subdomaincutToFirstSignificantSubdomain(x)Returns the part of the host of a URL up to the first significant subdomain.
cut_wwwcutWWW(x)Removes a leading www from the host of a URL.
date_adddateAdd, date_add(unit, x, y)Adds a number of units to a date or timestamp.
date_diffdateDiff, date_diff(unit, x, y)Returns the number of unit boundaries crossed between two dates or timestamps.
date_namedateName(unit, x)Returns the name of one part of a date or timestamp, such as the month name, as text.
date_subdateSub, date_sub(unit, x, y)Subtracts a number of units from a date or timestamp.
date_trunc(unit, x)Rounds a date or timestamp down to the start of the given unit.
decode_url_componentdecodeURLComponent(x)Decodes the percent escapes of a URL component.
decode_url_form_componentdecodeURLFormComponent(x)Decodes the percent escapes of a URL form component, where a plus sign is a space.
degrees(x)Converts an angle from radians to degrees.
dict_getdictGet(x1, x2, ...)Returns the value of an attribute from a dictionary for a key.
dict_get_or_defaultdictGetOrDefault(x1, x2, ...)Returns the value of an attribute from a dictionary for a key, or a given default when the key is missing.
dict_get_or_nulldictGetOrNull(x1, x2, ...)Returns the value of an attribute from a dictionary for a key, or NULL when the key is missing.
dict_hasdictHas(x1, x2, ...)Returns 1 when a dictionary has the key and 0 otherwise.
display_namedisplayName()Returns the host name of the server.
domain(x)Returns the host name of a URL.
domain_without_wwwdomainWithoutWWW(x)Returns the host name of a URL without a leading www.
dot_productdotProduct(x, y)Returns the dot product of two vectors.
e()Returns the number e.
edit_distanceeditDistance, levenshteinDistance(x, y)Returns the Levenshtein edit distance between two strings.
empty(x)Returns 1 when a string or array is empty and 0 otherwise.
encode_url_componentencodeURLComponent(x)Encodes a string as a URL component with percent escapes.
encode_url_form_componentencodeURLFormComponent(x)Encodes a string as a URL form component, where a space becomes a plus sign.
ends_withendsWith(x, y)Returns 1 when a string ends with the given suffix and 0 otherwise.
erf(x)Returns the error function of a number.
erfc(x)Returns the complementary error function of a number.
eval_ml_methodevalMLMethod(model, feature1, ...)Applies a trained model state to feature values and returns the prediction.
exp(x)Returns e raised to a power.
exp10(x)Returns 10 raised to a power.
exp2(x)Returns 2 raised to a power.
extract(unit FROM x)Returns one field of a date or timestamp, such as the year or the hour, named by a unit.
extract_allextractAll(x, y)Returns an array of all matches of a regular expression in a string.
extract_groupsextractGroups(x, y)Returns the capture groups of the first match of a regular expression as an array.
extract_regex(x, y)Returns the first capture group of the first match of a regular expression, or an empty string when nothing matches.
extract_url_parameterextractURLParameter(x, y)Returns the value of a named query parameter of a URL.
extract_url_parameter_namesextractURLParameterNames(x)Returns the names of the query parameters of a URL as an array.
extract_url_parametersextractURLParameters(x)Returns the query parameters of a URL as an array of name=value strings.
factorial(x)Returns the factorial of a non-negative integer.
floor(x[, y])Rounds a number down to the number of decimal places given as the optional second argument.
format(x1, x2, ...)Fills the placeholders of a format string with the following arguments.
format_date_timeformatDateTime, formatDatetime(x, y)Formats a date or timestamp as text using a format string with percent codes.
format_readable_quantityformatReadableQuantity(x[, y])Formats a number as text with a decimal unit, such as 1.00 million.
format_readable_sizeformatReadableSize, FORMAT_BYTES(x[, y])Formats a number of bytes as text with a binary unit, such as 1.00 KiB.
fragment(x)Returns the fragment of a URL without the leading hash sign.
from_unix_timestampfromUnixTimestamp(x)Converts seconds since the Unix epoch to a DateTime.
from_unix_timestamp64_microfromUnixTimestamp64Micro(x)Converts microseconds since the Unix epoch to a timestamp.
from_unix_timestamp64_millifromUnixTimestamp64Milli(x)Converts milliseconds since the Unix epoch to a timestamp.
from_unix_timestamp64_nanofromUnixTimestamp64Nano(x)Converts nanoseconds since the Unix epoch to a timestamp.
gcd(x, y)Returns the greatest common divisor of two integers.
greatest(x1, x2, ...)Returns the largest of its arguments.
half_md5halfMD5(x)Returns the first 8 bytes of the MD5 hash of a string as a 64-bit number.
has(x, y)Returns 1 when an array contains a value or a map contains a key, and 0 otherwise.
hex(x)Returns the hexadecimal text form of a value.
hive_hashhiveHash(x)Returns the Hive hash of a value.
host_namehostName()Returns the host name of the server.
hypot(x, y)Returns the length of the hypotenuse of a right triangle with the given sides.
if_nullifNull(x, y)Returns the second argument when the first is NULL, and the first otherwise.
int_divintDiv(x, y)Divides two numbers and rounds the result towards zero to an integer.
int_div_or_zerointDivOrZero(x, y)Divides two numbers and rounds towards zero, or returns zero when the divisor is zero.
int_exp10intExp10(x)Returns 10 raised to an integer power as an integer.
int_exp2intExp2(x)Returns 2 raised to an integer power as an integer.
int_hash32intHash32(x)Returns a 32-bit hash of an integer.
int_hash64intHash64(x)Returns a 64-bit hash of an integer.
ipv4_num_to_stringIPv4NumToString, INET_NTOA(x)Converts an IPv4 address from a number to dotted text.
ipv4_num_to_string_class_cIPv4NumToStringClassC(x)Converts an IPv4 address from a number to dotted text with the last byte replaced by xxx.
ipv4_string_to_numIPv4StringToNum, INET_ATON(x)Converts an IPv4 address from dotted text to a number.
ipv4_string_to_num_or_defaultIPv4StringToNumOrDefault(x)Converts an IPv4 address from dotted text to a number, or returns zero when the text is not an address.
ipv4_string_to_num_or_nullIPv4StringToNumOrNull(x)Converts an IPv4 address from dotted text to a number, or returns NULL when the text is not an address.
is_finiteisFinite(x)Returns 1 when a number is neither infinite nor NaN and 0 otherwise.
is_infiniteisInfinite(x)Returns 1 when a number is infinite and 0 otherwise.
is_ipv4_stringisIPv4String(x)Returns 1 when a string is a valid IPv4 address and 0 otherwise.
is_ipv6_stringisIPv6String(x)Returns 1 when a string is a valid IPv6 address and 0 otherwise.
is_nanisNaN(x)Returns 1 when a number is NaN and 0 otherwise.
is_not_nullisNotNull(x)Returns 0 when the value is NULL and 1 otherwise.
is_nullisNull(x)Returns 1 when the value is NULL and 0 otherwise.
is_valid_jsonisValidJSON(x)Returns 1 when a string is valid JSON and 0 otherwise.
java_hashjavaHash(x)Returns the Java hashCode of a value.
json_extract_array_rawJSONExtractArrayRaw(x1, x2, ...)Returns the elements of the JSON array at the given path as an array of raw JSON text.
json_extract_boolJSONExtractBool(x1, x2, ...)Returns the value at the given path of a JSON string as a Boolean.
json_extract_floatJSONExtractFloat(x1, x2, ...)Returns the value at the given path of a JSON string as a float.
json_extract_intJSONExtractInt(x1, x2, ...)Returns the value at the given path of a JSON string as a signed integer.
json_extract_keysJSONExtractKeys(x1, x2, ...)Returns the keys of the JSON object at the given path as an array.
json_extract_rawJSONExtractRaw(x1, x2, ...)Returns the value at the given path of a JSON string as raw JSON text.
json_extract_stringJSONExtractString(x1, x2, ...)Returns the value at the given path of a JSON string as a string.
json_extract_uintJSONExtractUInt(x1, x2, ...)Returns the value at the given path of a JSON string as an unsigned integer.
json_hasJSONHas(x1, x2, ...)Returns 1 when a JSON string has the value at the given path and 0 otherwise.
json_lengthJSONLength(x1, x2, ...)Returns the number of elements of the JSON array or object at the given path.
json_typeJSONType(x1, x2, ...)Returns the JSON type of the value at the given path as text.
l1_distanceL1Distance(x, y)Returns the Manhattan distance between two vectors.
l1_normL1Norm(x)Returns the sum of the absolute values of a vector.
l2_distancel2Distance(x, y)Returns the Euclidean distance between two vectors.
l2_normL2Norm(x)Returns the Euclidean length of a vector.
l2_squared_distanceL2SquaredDistance(x, y)Returns the squared Euclidean distance between two vectors.
l2_squared_normL2SquaredNorm(x)Returns the squared Euclidean length of a vector.
lcm(x, y)Returns the least common multiple of two integers.
least(x1, x2, ...)Returns the smallest of its arguments.
left(x, y)Returns the first given number of bytes of a string.
left_padleftPad, lpad(x1, x2, ...)Pads a string on the left to the given length, with spaces or a given fill string.
left_pad_utf8leftPadUTF8(x1, x2, ...)Pads a UTF-8 string on the left to the given length in code points.
left_utf8leftUTF8(x, y)Returns the first given number of code points of a UTF-8 string.
lengthcardinality(x)Returns the length of a string in bytes, or the number of elements of an array or map. Returns UInt64.
length_utf8lengthUTF8, char_length, character_length(x)Returns the length of a string in Unicode code points.
lgamma(x)Returns the natural logarithm of the absolute value of the gamma function.
linf_distanceLinfDistance(x, y)Returns the largest absolute difference between the elements of two vectors.
linf_normLinfNorm(x)Returns the largest absolute value in a vector.
llm_classifyllmClassify(x1, x2, ...)Asks the configured language model to pick one of the given labels for a text.
llm_embedllmEmbed(x[, y])Asks the configured language model for the embedding vector of a text.
llm_summarizellmSummarize(x[, y])Asks the configured language model for a summary of the texts of a group.
logln(x)Returns the natural logarithm of a number.
log10(x)Returns the base 10 logarithm of a number.
log2(x)Returns the base 2 logarithm of a number.
lowerlcase(x)Converts ASCII letters of a string to lower case.
lower_utf8lowerUTF8(x)Converts the letters of a UTF-8 string to lower case.
lp_normLpNorm(x, y)Returns the p-norm of a vector for the exponent given as the second argument.
map_concatmapConcat(map1, map2, ...)Merges maps into one map.
map_from_arraysmapFromArrays(x, y)Builds a map from an array of keys and an array of values.
map_keysmapKeys(x)Returns the keys of a map as an array.
map_valuesmapValues(x)Returns the values of a map as an array.
mask_hash(x, y)Replaces a value with a short hash of the value and a salt, so equal values stay equal.
mask_null(x)Replaces a value with NULL. Data policies use it to hide a column.
mask_partial(x)Replaces all but the last four bytes of a string with asterisks. Strings of four bytes or less are masked completely.
mask_redact(x)Replaces a value with a fixed value of the same type: three asterisks for text, zero for numbers and the epoch for times.
matchREGEXP_MATCHES(x, y)Returns 1 when a string matches a regular expression anywhere and 0 otherwise.
md5(x)Returns the MD5 hash of a string.
modulomod(x, y)Returns the remainder of a division.
modulo_or_zeromoduloOrZero(x, y)Returns the remainder of a division, or zero when the divisor is zero.
negate(x)Returns a number with its sign reversed.
netloc(x)Returns the network location of a URL: user information, host and port.
normalize_l2normalizeL2, L2Normalize(x)Scales a vector to Euclidean length 1.
not_emptynotEmpty(x)Returns 1 when a string or array is not empty and 0 otherwise.
null_ifnullIf(x, y)Returns NULL when the two arguments are equal, and the first argument otherwise.
path(x)Returns the path of a URL without the query string.
path_fullpathFull(x)Returns the path of a URL with the query string and fragment.
pi()Returns the number pi.
port(x[, y])Returns the port of a URL, or a default given as the optional second argument.
position(x1, x2, ...)Returns the 1-based position of a substring in a string, or 0 when it is not found.
position_case_insensitivepositionCaseInsensitive(x1, x2, ...)Returns the 1-based position of a substring in a string, ignoring case, or 0 when it is not found.
positive_modulopositiveModulo, pmod(x, y)Returns the remainder of a division, always zero or positive for a positive divisor.
powpower(x, y)Raises the first argument to the power of the second.
protocol(x)Returns the scheme of a URL, such as https.
query_stringqueryString(x)Returns the query string of a URL without the leading question mark.
query_string_and_fragmentqueryStringAndFragment(x)Returns the query string and the fragment of a URL.
radians(x)Converts an angle from degrees to radians.
range(x1, x2, ...)Returns an array of integers from a start up to but not including an end, with an optional step.
regexp_extractregexpExtract(x1, x2, ...)Returns a capture group of the first match of a regular expression, chosen by an optional group number.
regexp_quote_metaregexpQuoteMeta(x)Escapes the characters of a string that have a special meaning in a regular expression.
repeat(x, y)Repeats a string the given number of times.
replace_allreplaceAll, replace(x1, x2, ...)Replaces every occurrence of a substring.
replace_onereplaceOne(x1, x2, ...)Replaces the first occurrence of a substring.
replace_regexp_allreplaceRegexpAll, REGEXP_REPLACE(x1, x2, ...)Replaces every match of a regular expression.
replace_regexp_onereplaceRegexpOne(x1, x2, ...)Replaces the first match of a regular expression.
reverse(x)Reverses the bytes of a string or the elements of an array.
reverse_utf8reverseUTF8(x)Reverses the code points of a UTF-8 string.
revision()Returns the ClickHouse protocol revision number the server reports. Returns UInt32.
right(x, y)Returns the last given number of bytes of a string.
right_padrightPad, rpad(x1, x2, ...)Pads a string on the right to the given length, with spaces or a given fill string.
right_pad_utf8rightPadUTF8(x1, x2, ...)Pads a UTF-8 string on the right to the given length in code points.
right_utf8rightUTF8(x, y)Returns the last given number of code points of a UTF-8 string.
round(x[, y])Rounds a number to the number of decimal places given as the optional second argument.
round_ageroundAge(x)Returns the lower bound of the age bucket (0, 17, 18, 25, 35, 45 or 55) that holds an age in years.
round_bankersroundBankers(x[, y])Rounds a number half to even, to the number of decimal places given as the optional second argument.
round_durationroundDuration(x)Returns the lower bound, in seconds, of the duration bucket that holds a duration in seconds.
round_to_exp2roundToExp2(x)Rounds a number down to the nearest power of two.
sha1(x)Returns the SHA-1 hash of a string.
sha224(x)Returns the SHA-224 hash of a string.
sha256(x)Returns the SHA-256 hash of a string.
sha512(x)Returns the SHA-512 hash of a string.
sign(x)Returns -1, 0 or 1 for a negative, zero or positive number.
simple_json_extract_boolsimpleJSONExtractBool, visitParamExtractBool(x, y)Returns a field of a JSON string as a Boolean. It does a fast text search and does not fully parse the JSON.
simple_json_extract_floatsimpleJSONExtractFloat, visitParamExtractFloat(x, y)Returns a field of a JSON string as a float. It does a fast text search and does not fully parse the JSON.
simple_json_extract_intsimpleJSONExtractInt, visitParamExtractInt(x, y)Returns a field of a JSON string as a signed integer. It does a fast text search and does not fully parse the JSON.
simple_json_extract_rawsimpleJSONExtractRaw, visitParamExtractRaw(x, y)Returns a field of a JSON string as a raw JSON text. It does a fast text search and does not fully parse the JSON.
simple_json_extract_stringsimpleJSONExtractString, visitParamExtractString(x, y)Returns a field of a JSON string as a string. It does a fast text search and does not fully parse the JSON.
simple_json_extract_uintsimpleJSONExtractUInt, visitParamExtractUInt(x, y)Returns a field of a JSON string as a unsigned integer. It does a fast text search and does not fully parse the JSON.
simple_json_hassimpleJSONHas, visitParamHas(x, y)Returns 1 when a JSON string has the given field and 0 otherwise.
sin(x)Returns the sine of a number.
sinh(x)Returns the hyperbolic sine of a number.
sip_hash64sipHash64(x)Returns the SipHash 64-bit hash of a value.
space(x)Returns a string of the given number of spaces.
split_by_charsplitByChar(x1, x2, ...)Splits a string at a single separator character into an array.
split_by_non_alphasplitByNonAlpha(x[, y])Splits a string at characters that are not letters or digits into an array.
split_by_stringsplitByString(x1, x2, ...)Splits a string at a separator string into an array.
split_by_whitespacesplitByWhitespace(x[, y])Splits a string at runs of whitespace into an array.
sqrt(x)Returns the square root of a number.
starts_withstartsWith(x, y)Returns 1 when a string starts with the given prefix and 0 otherwise.
string_arraystringArray(x1, x2, ...)Builds an array of strings from its arguments.
substringsubstr, mid(x1, x2, ...)Returns part of a string, given a start position and an optional length counted in bytes.
substring_indexsubstringIndex, SUBSTRING_INDEX(x1, x2, ...)Returns the part of a string before the given number of occurrences of a delimiter.
substring_utf8substringUTF8, substrUTF8(x1, x2, ...)Returns part of a UTF-8 string, given a start position and an optional length counted in code points.
subtract_dayssubtractDays(x, y)Subtracts a number of days from a date or timestamp.
subtract_hourssubtractHours(x, y)Subtracts a number of hours from a date or timestamp.
subtract_minutessubtractMinutes(x, y)Subtracts a number of minutes from a date or timestamp.
subtract_monthssubtractMonths(x, y)Subtracts a number of months from a date or timestamp.
subtract_quarterssubtractQuarters(x, y)Subtracts a number of quarters from a date or timestamp.
subtract_secondssubtractSeconds(x, y)Subtracts a number of seconds from a date or timestamp.
subtract_weekssubtractWeeks(x, y)Subtracts a number of weeks from a date or timestamp.
subtract_yearssubtractYears(x, y)Subtracts a number of years from a date or timestamp.
tan(x)Returns the tangent of a number.
tanh(x)Returns the hyperbolic tangent of a number.
tgamma(x)Returns the gamma function of a number.
timezonetimeZone()Returns the time zone name, which is always UTC.
to_booltoBool(x)Converts a value to Bool.
to_datetoDate(x)Converts a string, number or timestamp to a Date.
to_date_or_nulltoDateOrNull(x)Converts a value to a Date, or returns NULL when it cannot be converted.
to_date_timetoDateTime(x)Converts a string, number or timestamp to a DateTime with second precision.
to_date_time64toDateTime64(x[, y])Converts a value to a timestamp rounded down to the number of decimal places given as the second argument.
to_date_time_or_nulltoDateTimeOrNull(x)Converts a value to a DateTime, or returns NULL when it cannot be converted.
to_day_of_monthtoDayOfMonth(x)Returns the day of the month of a date or timestamp.
to_day_of_weektoDayOfWeek(x[, y])Returns the day of the week of a date or timestamp, with Monday as 1. The optional second argument selects the week mode.
to_day_of_yeartoDayOfYear(x)Returns the day of the year of a date or timestamp.
to_decimal32toDecimal32(x[, y])Converts a value to a Decimal32 with the scale given as the second argument.
to_decimal32_or_nulltoDecimal32OrNull(x[, y])Converts a value to a Decimal32, or returns NULL when it cannot be converted.
to_decimal32_or_zerotoDecimal32OrZero(x[, y])Converts a value to a Decimal32, or returns zero when it cannot be converted.
to_decimal64toDecimal64(x[, y])Converts a value to a Decimal64 with the scale given as the second argument.
to_decimal64_or_nulltoDecimal64OrNull(x[, y])Converts a value to a Decimal64, or returns NULL when it cannot be converted.
to_decimal64_or_zerotoDecimal64OrZero(x[, y])Converts a value to a Decimal64, or returns zero when it cannot be converted.
to_float32toFloat32(x)Converts a value to Float32.
to_float32_or_nulltoFloat32OrNull(x)Converts a value to Float32, or returns NULL when it cannot be converted.
to_float32_or_zerotoFloat32OrZero(x)Converts a value to Float32, or returns zero when it cannot be converted.
to_float64toFloat64(x)Converts a value to Float64.
to_float64_or_nulltoFloat64OrNull(x)Converts a value to Float64, or returns NULL when it cannot be converted.
to_float64_or_zerotoFloat64OrZero(x)Converts a value to Float64, or returns zero when it cannot be converted.
to_hourtoHour(x)Returns the hour of a date or timestamp.
to_int16toInt16(x)Converts a value to Int16.
to_int16_or_nulltoInt16OrNull(x)Converts a value to Int16, or returns NULL when it cannot be converted.
to_int16_or_zerotoInt16OrZero(x)Converts a value to Int16, or returns zero when it cannot be converted.
to_int32toInt32(x)Converts a value to Int32.
to_int32_or_nulltoInt32OrNull(x)Converts a value to Int32, or returns NULL when it cannot be converted.
to_int32_or_zerotoInt32OrZero(x)Converts a value to Int32, or returns zero when it cannot be converted.
to_int64toInt64(x)Converts a value to Int64.
to_int64_or_nulltoInt64OrNull(x)Converts a value to Int64, or returns NULL when it cannot be converted.
to_int64_or_zerotoInt64OrZero(x)Converts a value to Int64, or returns zero when it cannot be converted.
to_int8toInt8(x)Converts a value to Int8.
to_int8_or_nulltoInt8OrNull(x)Converts a value to Int8, or returns NULL when it cannot be converted.
to_int8_or_zerotoInt8OrZero(x)Converts a value to Int8, or returns zero when it cannot be converted.
to_ipv4toIPv4(x)Converts dotted text or a number to an IPv4 value.
to_iso_weektoISOWeek(x)Returns the ISO week number of a date or timestamp.
to_iso_yeartoISOYear(x)Returns the ISO year of a date or timestamp.
to_minutetoMinute(x)Returns the minute of a date or timestamp.
to_mondaytoMonday(x)Rounds a date or timestamp down to the Monday of its week.
to_monthtoMonth(x)Returns the month of a date or timestamp.
to_quartertoQuarter(x)Returns the quarter of a date or timestamp.
to_relative_day_numtoRelativeDayNum(x)Returns the number of days since the Unix epoch for a date or timestamp.
to_secondtoSecond(x)Returns the second of a date or timestamp.
to_start_of_daytoStartOfDay(x)Rounds a date or timestamp down to the start of its day.
to_start_of_fifteen_minutestoStartOfFifteenMinutes(x)Rounds a date or timestamp down to the start of its fifteen-minute interval.
to_start_of_five_minutestoStartOfFiveMinutes, toStartOfFiveMinute(x)Rounds a date or timestamp down to the start of its five-minute interval.
to_start_of_hourtoStartOfHour(x)Rounds a date or timestamp down to the start of its hour.
to_start_of_intervaltoStartOfInterval(x, INTERVAL n unit)Rounds a timestamp down to the start of an interval written as INTERVAL n unit.
to_start_of_minutetoStartOfMinute(x)Rounds a date or timestamp down to the start of its minute.
to_start_of_monthtoStartOfMonth(x)Rounds a date or timestamp down to the start of its month.
to_start_of_quartertoStartOfQuarter(x)Rounds a date or timestamp down to the start of its quarter.
to_start_of_ten_minutestoStartOfTenMinutes(x)Rounds a date or timestamp down to the start of its ten-minute interval.
to_start_of_weektoStartOfWeek(x[, y])Rounds a date or timestamp down to the start of its week. The optional second argument selects the week mode.
to_start_of_yeartoStartOfYear(x)Rounds a date or timestamp down to the start of its year.
to_stringtoString(x)Converts a value to its text form.
to_type_nametoTypeName(x)Returns the name of the type of a value as text.
to_uint16toUInt16(x)Converts a value to UInt16.
to_uint16_or_nulltoUInt16OrNull(x)Converts a value to UInt16, or returns NULL when it cannot be converted.
to_uint16_or_zerotoUInt16OrZero(x)Converts a value to UInt16, or returns zero when it cannot be converted.
to_uint32toUInt32(x)Converts a value to UInt32. Returns UInt32.
to_uint32_or_nulltoUInt32OrNull(x)Converts a value to UInt32, or returns NULL when it cannot be converted. Returns UInt32.
to_uint32_or_zerotoUInt32OrZero(x)Converts a value to UInt32, or returns zero when it cannot be converted. Returns UInt32.
to_uint64toUInt64(x)Converts a value to UInt64. Returns UInt64.
to_uint64_or_nulltoUInt64OrNull(x)Converts a value to UInt64, or returns NULL when it cannot be converted. Returns UInt64.
to_uint64_or_zerotoUInt64OrZero(x)Converts a value to UInt64, or returns zero when it cannot be converted. Returns UInt64.
to_uint8toUInt8(x)Converts a value to UInt8.
to_uint8_or_nulltoUInt8OrNull(x)Converts a value to UInt8, or returns NULL when it cannot be converted.
to_uint8_or_zerotoUInt8OrZero(x)Converts a value to UInt8, or returns zero when it cannot be converted.
to_unix_timestamptoUnixTimestamp(x)Returns a date or timestamp as seconds since the Unix epoch.
to_weektoWeek, week(x[, y])Returns the week number of a date or timestamp. The optional second argument selects the week mode.
to_yeartoYear(x)Returns the year of a date or timestamp.
to_year_weektoYearWeek, yearweek(x[, y])Returns the year and week number of a date or timestamp as one number. The optional second argument selects the week mode.
to_yyyymmtoYYYYMM(x)Returns the year and month of a date or timestamp as a number such as 202610.
to_yyyymmddtoYYYYMMDD(x)Returns the date of a date or timestamp as a number such as 20261031.
to_yyyymmddhhmmsstoYYYYMMDDhhmmss(x)Returns the date and time of a date or timestamp as a number such as 20261031235959.
top_level_domaintopLevelDomain(x)Returns the top-level domain of a URL, such as com.
translate(x1, x2, ...)Replaces each character found in the second argument with the character at the same position in the third; characters with no counterpart are removed.
trim_bothtrimBoth, trim(x[, y])Removes leading and trailing spaces, or the characters given as the optional second argument.
trim_lefttrimLeft, ltrim(x[, y])Removes leading spaces, or the leading characters given as the optional second argument.
trim_righttrimRight, rtrim(x[, y])Removes trailing spaces, or the trailing characters given as the optional second argument.
trunctruncate(x[, y])Rounds a number towards zero to the number of decimal places given as the optional second argument.
unbin(x)Converts binary text to the bytes it encodes.
unhex(x)Converts hexadecimal text to the bytes it encodes.
upperucase(x)Converts ASCII letters of a string to upper case.
upper_utf8upperUTF8(x)Converts the letters of a UTF-8 string to upper case.
version()Returns the server version as text, in the form ClickHouse clients expect.
wy_hash64wyHash64(x)Returns the wyHash 64-bit hash of a value.
xx_hash32xxHash32(x)Returns the xxHash 32-bit hash of a value.
xx_hash64xxHash64(x)Returns the xxHash 64-bit hash of a value.