Skip to content

Functions

FunctionWrapper

Auto generated ClickHouse functions.

BLAKE3(message) staticmethod

BLAKE3(message)

  • message — The input string to hash. String

Returns the 32-byte BLAKE3 hash of the input string as a fixed-length string. FixedString(32)

CAST(x, T) staticmethod

CAST(x, T) or CAST(x AS T) or x::T

  • x — A value of any type. Any
  • T — The target data type. String

Returns the converted value with the target data type. Any

CRC32(s) staticmethod

CRC32(s)

  • s — String to calculate CRC32 for. String

Returns the CRC32 checksum of the string. UInt32

CRC32IEEE(s) staticmethod

CRC32IEEE(s)

  • s — String to calculate CRC32 for. String

Returns the CRC32 checksum of the string. UInt32

CRC64(s) staticmethod

CRC64(s)

  • s — String to calculate CRC64 for. String

Returns the CRC64 checksum of the string. UInt64

DATE(expr) staticmethod

DATE(expr)

Returns a Date value. Date

FQDN() staticmethod

FQDN()

Returns the fully qualified domain name of the ClickHouse server. String

HMAC(mode, message, key) staticmethod

HMAC(mode, message, key)

  • mode — Hash algorithm name (case-insensitive). Supported: md5, sha1, sha224, sha256, sha384, sha512. String
  • message — Message to be authenticated. String
  • key — Secret key for HMAC. String

Returns a binary string containing the HMAC digest. String

IPv4CIDRToRange(ipv4, cidr) staticmethod

IPv4CIDRToRange(ipv4, cidr)

Returns a tuple with two IPv4 addresses representing the subnet range. Tuple(IPv4, IPv4)

IPv4NumToString(num) staticmethod

IPv4NumToString(num)

  • num — IPv4 address as UInt32 number. UInt32

Returns a number representing the MAC address, or 0 if the format is invalid. String

IPv4NumToStringClassC(num) staticmethod

IPv4NumToStringClassC(num)

  • num — IPv4 address as UInt32 number. UInt32

Returns the IPv4 address string with xxx replacing the last octet. String

IPv4StringToNum(string) staticmethod

IPv4StringToNum(string)

  • string — IPv4 address string. String

Returns theIPv4 address. UInt32

IPv4StringToNumOrDefault(string) staticmethod

IPv4StringToNumOrDefault(string)

  • string — IPv4 address string. String

Returns the IPv4 address, or 0 if invalid. UInt32

IPv4StringToNumOrNull(string) staticmethod

IPv4StringToNumOrNull(string)

  • string — IPv4 address string. String

Returns the IPv4 address, or NULL if invalid. Nullable(UInt32)

IPv4ToIPv6(x) staticmethod

IPv4ToIPv6(x)

Returns an IPv6 address in binary format. FixedString(16)

IPv6CIDRToRange(ipv6, cidr) staticmethod

IPv6CIDRToRange(ipv6, cidr)

Returns a tuple with two IPv6 addresses representing the subnet range. Tuple(IPv6, IPv6)

IPv6NumToString(x) staticmethod

IPv6NumToString(x)

Returns the IPv6 address string in text format. String

IPv6StringToNum(string) staticmethod

IPv6StringToNum(string)

  • string — IPv6 address string. String

Returns theIPv6 address in binary format. FixedString(16)

IPv6StringToNumOrDefault(string) staticmethod

IPv6StringToNumOrDefault(string)

  • string — IPv6 address string. String

IPv6 address in binary format, or zero-filled FixedString(16) if invalid. FixedString(16)

IPv6StringToNumOrNull(string) staticmethod

IPv6StringToNumOrNull(string)

  • string — IPv6 address string. String

Returns IPv6 address in binary format, or NULL if invalid. Nullable(FixedString(16))

JSONAllPaths(json) staticmethod

JSONAllPaths(json)

  • json — JSON column. JSON

Returns an array of all paths in the JSON column. Array(String)

JSONAllPathsWithTypes(json) staticmethod

JSONAllPathsWithTypes(json)

  • json — JSON column. JSON

Returns a map of all paths and their data types in the JSON column. Map(String, String)

JSONArrayLength(json) staticmethod

JSONArrayLength(json)

  • json — String with valid JSON. String

Returns the number of array elements if json is a valid JSON array string, otherwise returns NULL. Nullable(UInt64)

JSONDynamicPaths(json) staticmethod

JSONDynamicPaths(json)

  • json — JSON column. JSON

Returns an array of dynamic paths in the JSON column. Array(String)

JSONDynamicPathsWithTypes(json) staticmethod

JSONDynamicPathsWithTypes(json)

  • json — JSON column. JSON

Returns a map of dynamic paths and their data types in the JSON column. Map(String, String)

JSONExtract(json, indices_or_keys=None, return_type=None) staticmethod

JSONExtract(json[, indices_or_keys, ...], return_type)

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*
  • return_type — ClickHouse data type to return. String

Returns a value of specified ClickHouse data type if possible, otherwise returns the default value for that type.

JSONExtractArrayRaw(json, indices_or_keys=None) staticmethod

JSONExtractArrayRaw(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns an array of strings with JSON array elements. If the part is not an array or does not exist, an empty array will be returned. Array(String)

JSONExtractArrayRawCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractArrayRawCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the array. Keys use case-insensitive matching String or (U)Int*

Returns an array of raw JSON strings. Array(String)

JSONExtractBool(json, indices_or_keys=None) staticmethod

JSONExtractBool(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns a Bool value if it exists, otherwise returns 0. Bool

JSONExtractBoolCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractBoolCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching String or (U)Int*

Returns the extracted boolean value (1 for true, 0 for false), 0 if not found. UInt8

JSONExtractCaseInsensitive(json, indices_or_keys=None, return_type=None) staticmethod

JSONExtractCaseInsensitive(json [, indices_or_keys...], return_type)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching String or (U)Int*
  • return_type — The ClickHouse data type to extract String

Returns the extracted value in the specified data type. Any

JSONExtractFloat(json, indices_or_keys=None) staticmethod

JSONExtractFloat(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns a Float value if it exists, otherwise returns 0. Float64

JSONExtractFloatCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractFloatCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching String or (U)Int*

Returns the extracted Float value, 0 if not found or cannot be converted. Float64

JSONExtractInt(json, indices_or_keys=None) staticmethod

JSONExtractInt(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns an Int value if it exists, otherwise returns 0. Int64

JSONExtractIntCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractIntCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching String or (U)Int*

Returns the extracted Int value, 0 if not found or cannot be converted. Int64

JSONExtractKeys(json, indices_or_keys=None) staticmethod

JSONExtractKeys(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns an array with the keys of the JSON object. Array(String)

JSONExtractKeysAndValues(json, indices_or_keys=None, value_type=None) staticmethod

JSONExtractKeysAndValues(json[, indices_or_keys, ...], value_type)

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*
  • value_type — ClickHouse data type of the values. String

Returns an array of tuples with the parsed key-value pairs. Array(Tuple(String, value_type))

JSONExtractKeysAndValuesCaseInsensitive(json, indices_or_keys=None, value_type=None) staticmethod

JSONExtractKeysAndValuesCaseInsensitive(json [, indices_or_keys...], value_type)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the object. Keys use case-insensitive matching String or (U)Int*
  • value_type — The ClickHouse data type of the values String

Returns an array of tuples containing key-value pairs. Array(Tuple(String, T))

JSONExtractKeysAndValuesRaw(json, indices_or_keys=None) staticmethod

JSONExtractKeysAndValuesRaw(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns an array of tuples with parsed key-value pairs where values are unparsed strings. Array(Tuple(String, String))

JSONExtractKeysAndValuesRawCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractKeysAndValuesRawCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the object. Keys use case-insensitive matching String or (U)Int*

Returns an array of tuples containing key-value pairs as raw strings. Array(Tuple(String, String))

JSONExtractKeysCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractKeysCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the object. Keys use case-insensitive matching String or (U)Int*

Returns an array of keys from the JSON object. Array(String)

JSONExtractRaw(json, indices_or_keys=None) staticmethod

JSONExtractRaw(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns the part of JSON as an unparsed string. If the part does not exist or has a wrong type, an empty string will be returned. String

JSONExtractRawCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractRawCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching String or (U)Int*

Returns the raw JSON string of the extracted element. String

JSONExtractString(json, indices_or_keys=None) staticmethod

JSONExtractString(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns a String value if it exists, otherwise returns an empty string. String

JSONExtractStringCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractStringCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching String or (U)Int*

Returns the extracted string value, empty string if not found. String

JSONExtractUInt(json, indices_or_keys=None) staticmethod

JSONExtractUInt(json [, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — A list of zero or more arguments each of which can be either string or integer. String or (U)Int*

Returns a UInt value if it exists, otherwise returns 0. UInt64

JSONExtractUIntCaseInsensitive(json, indices_or_keys=None) staticmethod

JSONExtractUIntCaseInsensitive(json [, indices_or_keys]...)

  • json — JSON string to parse String
  • indices_or_keys — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching String or (U)Int*

Returns the extracted UInt value, 0 if not found or cannot be converted. UInt64

JSONHas(json, indices_or_keys=None) staticmethod

JSONHas(json[ ,indices_or_keys, ...])

  • json — JSON string to parse String
  • [ ,indices_or_keys, ...] — A list of zero or more arguments. String or (U)Int*

Returns 1 if the value exists in json, otherwise 0 UInt8

JSONKey(json, indices_or_keys=None) staticmethod

JSONKey(json[, indices_or_keys, ...])

  • json — JSON string to parse. String
  • indices_or_keys — Optional list of indices or keys specifying a path to a nested element. Each argument can be either a string (access by key) or an integer (access by index starting from 1). String or Int*

Returns the key name at the specified position in the JSON object. String

JSONLength(json, indices_or_keys=None) staticmethod

JSONLength(json [, indices_or_keys, ...])

Returns the length of the JSON array or JSON object, otherwise returns 0 if the value does not exist or has the wrong type. UInt64

JSONMergePatch(json1, json2=None) staticmethod

JSONMergePatch(json1[, json2, ...])

  • json1[, json2, ...] — One or more strings with valid JSON. String

Returns the merged JSON object string, if the JSON object strings are valid. String

JSONSharedDataPaths(json) staticmethod

JSONSharedDataPaths(json)

  • json — JSON column. JSON

Returns an array of paths stored in shared data structure in the JSON column. Array(String)

JSONSharedDataPathsWithTypes(json) staticmethod

JSONSharedDataPathsWithTypes(json)

  • json — JSON column. JSON

Returns a map of paths stored in shared data structure and their data types in the JSON column. Map(String, String)

JSONType(json, indices_or_keys=None) staticmethod

JSONType(json[, indices_or_keys, ...])

  • json — JSON string to parse String
  • json[, indices_or_keys, ...] — A list of zero or more arguments, each of which can be either string or integer. String or (U)Int8/16/32/64

Returns the type of a JSON value as a string, otherwise if the value doesn't exist it returns Null=0 Enum

JSON_EXISTS(json, path) staticmethod

JSON_EXISTS(json, path)

  • json — A string with valid JSON. String
  • path — A string representing the path. String

Returns 1 if the value exists in the JSON document, otherwise 0. UInt8

JSON_QUERY(json, path) staticmethod

JSON_QUERY(json, path)

  • json — A string with valid JSON. String
  • path — A string representing the path. String

Returns the extracted JSON array or JSON object as a string, or an empty string if the value does not exist. String

JSON_VALUE(json, path) staticmethod

JSON_VALUE(json, path)

  • json — A string with valid JSON. String
  • path — A string representing the path. String

Returns the extracted JSON scalar as a string, or an empty string if the value does not exist. String

L1Distance(vector1, vector2) staticmethod

L1Distance(vector1, vector2)

Returns the 1-norm distance. UInt32 or Float64

L1Norm(vector) staticmethod

L1Norm(vector)

Returns the L1-norm or taxicab geometry distance. UInt* or Float* or Decimal

L1Normalize(tuple) staticmethod

L1Normalize(tuple)

  • tuple — A tuple of numeric values. Tuple(T)

Returns the unit vector. Tuple(Float64)

L2Distance(vector1, vector2) staticmethod

L2Distance(vector1, vector2)

Returns the 2-norm distance. Float64

L2DistanceTransposed(vector1, vector2, p) staticmethod

L2DistanceTransposed(vector1, vector2, p)

  • vectors — Vectors. QBit(T, UInt64)
  • reference — Reference vector. Array(T)
  • p — Number of bits from each vector element to use in the distance calculation (1 to element bit-width). The quantization level controls the precision-speed trade-off. Using fewer bits results in faster I/O and calculations with reduced accuracy, while using more bits increases accuracy at the cost of performance. UInt

Returns the approximate 2-norm distance. Float64

L2Norm(vector) staticmethod

L2Norm(vector)

Returns the L2-norm or Euclidean distance. UInt* or Float*

L2Normalize(tuple) staticmethod

L2Normalize(tuple)

  • tuple — A tuple of numeric values. Tuple(T)

Returns the unit vector. Tuple(Float64)

L2SquaredDistance(vector1, vector2) staticmethod

L2SquaredDistance(vector1, vector2)

Returns the sum of the squares of the difference between the corresponding elements of two vectors. Float64

L2SquaredNorm(vector) staticmethod

L2SquaredNorm(vector)

Returns the L2-norm squared. UInt* or Float* or Decimal

LinfDistance(vector1, vector2) staticmethod

LinfDistance(vector1, vector2)

Returns the Infinity-norm distance. Float64

LinfNorm(vector) staticmethod

LinfNorm(vector)

Returns the Linf-norm or the maximum absolute value. Float64

LinfNormalize(tuple) staticmethod

LinfNormalize(tuple)

  • tuple — A tuple of numeric values. Tuple(T)

Returns the unit vector. Tuple(Float64)

LpDistance(vector1, vector2, p) staticmethod

LpDistance(vector1, vector2, p)

Returns the p-norm distance. Float64

LpNorm(vector, p) staticmethod

LpNorm(vector, p)

  • vector — Vector or tuple of numeric values. Tuple(T) or Array(T)
  • p — The power. Possible values are real numbers in the range [1; inf). UInt* or Float*

Returns the Lp-norm. Float64

LpNormalize(tuple, p) staticmethod

LpNormalize(tuple, p)

  • tuple — A tuple of numeric values. Tuple(T)
  • p — The power. Possible values are any number in the range range from [1; inf). UInt* or Float*

Returns the unit vector. Tuple(Float64)

MACNumToString(num) staticmethod

MACNumToString(num)

  • num — UInt64 number. UInt64

Returns a MAC address in format AA:BB:CC:DD:EE:FF. String

MACStringToNum(s) staticmethod

MACStringToNum(s)

  • s — MAC address string. String

Returns a UInt64 number. UInt64

MACStringToOUI(s) staticmethod

MACStringToOUI(s)

  • s — MAC address string. String

First three octets as UInt64 number. UInt64

MD4(s) staticmethod

MD4(s)

  • s — The input string to hash. String

Returns the MD4 hash of the given input string as a fixed-length string. FixedString(16)

MD5(s) staticmethod

MD5(s)

  • s — The input string to hash. String

Returns the MD5 hash of the given input string as a fixed-length string. FixedString(16)

RIPEMD160(s) staticmethod

RIPEMD160(s)

  • s — The input string to hash. String

Returns the RIPEMD160 hash of the given input string as a fixed-length string. FixedString(20)

SHA1(s) staticmethod

SHA1(s)

  • s — The input string to hash String

Returns the SHA1 hash of the given input string as a fixed-length string. FixedString(20)

SHA224(s) staticmethod

SHA224(s)

  • s — The input value to hash. String

Returns the SHA224 hash of the given input string as a fixed-length string. FixedString(28)

SHA256(s) staticmethod

SHA256(s)

  • s — The input string to hash. String

Returns the SHA256 hash of the given input string as a fixed-length string. FixedString(32)

SHA384(s) staticmethod

SHA384(s)

  • s — The input string to hash. String

Returns the SHA384 hash of the given input string as a fixed-length string. FixedString(48)

SHA512(s) staticmethod

SHA512(s)

  • s — The input string to hash String

Returns the SHA512 hash of the given input string as a fixed-length string. FixedString(64)

SHA512_256(s) staticmethod

SHA512_256(s)

  • s — The input string to hash. String

Returns the SHA512_256 hash of the given input string as a fixed-length string. FixedString(32)

ULIDStringToDateTime(ulid, timezone=None) staticmethod

ULIDStringToDateTime(ulid[, timezone])

Timestamp with milliseconds precision. DateTime64(3)

URLHash(url, N=None) staticmethod

URLHash(url[, N])

  • url — URL string to hash. String
  • N — Optional. Level in the URL hierarchy. (U)Int*

Returns the computed hash value of url. UInt64

URLHierarchy(url) staticmethod

URLHierarchy(url)

  • url — The URL to process. String

Returns an array of progressively longer URLs forming a hierarchy. Array(String)

URLPathHierarchy(url) staticmethod

URLPathHierarchy(url)

  • url — The URL to process. String

Returns an array of progressively longer URL path components forming a hierarchy. Array(String)

UTCTimestamp() staticmethod

UTCTimestamp()

Returns the current date and time at the moment of query analysis. DateTime

UUIDNumToString(binary, variant=None) staticmethod

UUIDNumToString(binary[, variant])

  • binary — Binary representation of a UUID. FixedString(16)
  • variant — Variant as specified by RFC4122. 1 = Big-endian (default), 2 = Microsoft. (U)Int*

Returns the UUID as a string. String

UUIDStringToNum(string, variant=1) staticmethod

UUIDStringToNum(string[, variant = 1])

  • string — A string or fixed-string of 36 characters) String or FixedString(36)
  • variant — Variant as specified by RFC4122. 1 = Big-endian (default), 2 = Microsoft. (U)Int*

Returns the binary representation of string. FixedString(16)

UUIDToNum(uuid, variant=1) staticmethod

UUIDToNum(uuid[, variant = 1])

Returns a binary representation of the UUID. FixedString(16)

UUIDv7ToDateTime(uuid, timezone=None) staticmethod

UUIDv7ToDateTime(uuid[, timezone])

Returns a timestamp with milliseconds precision. If the UUID is not a valid version 7 UUID, it returns 1970-01-01 00:00:00.000. DateTime64(3)

YYYYMMDDToDate(YYYYMMDD) staticmethod

YYYYMMDDToDate(YYYYMMDD)

Returns a Date value from the provided arguments Date

YYYYMMDDToDate32(YYYYMMDD) staticmethod

YYYYMMDDToDate32(YYYYMMDD)

Returns a Date32 value from the provided arguments Date32

YYYYMMDDhhmmssToDateTime(YYYYMMDDhhmmss, timezone=None) staticmethod

YYYYMMDDhhmmssToDateTime(YYYYMMDDhhmmss[, timezone])

  • YYYYMMDDhhmmss — Number containing the year, month, day, hour, minute, and second. (U)Int* or Float* or Decimal
  • timezone — Timezone name. String

Returns a DateTime value from the provided arguments DateTime

YYYYMMDDhhmmssToDateTime64(YYYYMMDDhhmmss, precision=None, timezone=None) staticmethod

YYYYMMDDhhmmssToDateTime64(YYYYMMDDhhmmss[, precision[, timezone]])

  • YYYYMMDDhhmmss — Number containing the year, month, day, hour, minute, and second. (U)Int* or Float* or Decimal
  • precision — Precision for the fractional part (0-9). UInt8
  • timezone — Timezone name. String

Returns a DateTime64 value from the provided arguments DateTime64

abs(x) staticmethod

abs(x)

  • x — Value to get the absolute value of The absolute value of x

accurateCast(x, T) staticmethod

accurateCast(x, T)

  • x — A value to convert. Any
  • T — The target data type name. String

Returns the converted value with the target data type. Any

accurateCastOrDefault(x, T, default_value=None) staticmethod

accurateCastOrDefault(x, T[, default_value])

  • x — A value to convert. Any
  • T — The target data type name. const String
  • default_value — Optional. Default value to return if conversion fails. Any

Returns the converted value with the target data type, or the default value if conversion is not possible. Any

accurateCastOrNull(x, T) staticmethod

accurateCastOrNull(x, T)

  • x — A value to convert. Any
  • T — The target data type name. String

Returns the converted value with the target data type, or NULL if conversion is not possible. Any

acos(x) staticmethod

acos(x)

Returns the arc cosine of x Float*

acosh(x) staticmethod

acosh(x)

  • x — Hyperbolic cosine of angle. Values from the interval: 1 ≤ x < +∞. (U)Int* or Float* or Decimal*

Returns the angle, in radians. Values from the interval: 0 ≤ acosh(x) < +∞. Float64

addDate(datetime, interval) staticmethod

addDate(datetime, interval)

Returns date or date with time obtained by adding interval to datetime. Date or Date32 or DateTime or DateTime64

addDays(datetime, num) staticmethod

addDays(datetime, num)

Returns datetime plus num days. Date or Date32 or DateTime or DateTime64

addHours(datetime, num) staticmethod

addHours(datetime, num)

Returns datetime plus num hours DateTime or DateTime64(3)

addInterval(interval_1, interval_2) staticmethod

addInterval(interval_1, interval_2)

Returns a tuple of intervals Tuple(Interval)

addMicroseconds(datetime, num) staticmethod

addMicroseconds(datetime, num)

Returns date_time plus num microseconds DateTime64

addMilliseconds(datetime, num) staticmethod

addMilliseconds(datetime, num)

Returns datetime plus num milliseconds DateTime64

addMinutes(datetime, num) staticmethod

addMinutes(datetime, num)

Returns datetime plus num minutes DateTime or DateTime64(3)

addMonths(datetime, num) staticmethod

addMonths(datetime, num)

Returns datetime plus num months Date or Date32 or DateTime or DateTime64

addNanoseconds(datetime, num) staticmethod

addNanoseconds(datetime, num)

Returns datetime plus num nanoseconds DateTime64

addQuarters(datetime, num) staticmethod

addQuarters(datetime, num)

Returns datetime plus num quarters Date or Date32 or DateTime or DateTime64

addSeconds(datetime, num) staticmethod

addSeconds(datetime, num)

Returns datetime plus num seconds DateTime or DateTime64(3)

addTupleOfIntervals(datetime, intervals) staticmethod

addTupleOfIntervals(datetime, intervals)

Returns date with added intervals Date or Date32 or DateTime or DateTime64

addWeeks(datetime, num) staticmethod

addWeeks(datetime, num)

Returns datetime plus num weeks Date or Date32 or DateTime or DateTime64

addYears(datetime, num) staticmethod

addYears(datetime, num)

Returns datetime plus num years Date or Date32 or DateTime or DateTime64

addressToLine(address_of_binary_instruction) staticmethod

addressToLine(address_of_binary_instruction)

  • address_of_binary_instruction — Address of instruction in a running process. UInt64

Returns a source code filename and line number delimited by a colon, for example, /build/obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:199. Returns the name of a binary, if no debug information could be found, otherwise an empty string, if the address is not valid. String

addressToLineWithInlines(address_of_binary_instruction) staticmethod

addressToLineWithInlines(address_of_binary_instruction)

  • address_of_binary_instruction — The address of an instruction in a running process. UInt64

Returns an array whose first element is the source code filename and line number delimited by a colon. The second, third, etc. element list inline functions' source code filenames, line numbers and function names. If no debug information could be found, then an array with a single element equal to the name of the binary is returned, otherwise an empty array is returned if the address is not valid. Array(String)

addressToSymbol(address_of_binary_instruction) staticmethod

addressToSymbol(address_of_binary_instruction)

  • address_of_binary_instruction — Address of instruction in a running process. UInt64

Returns the symbol from ClickHouse object files or an empty string, if the address is not valid. String

aes_decrypt_mysql(mode, ciphertext, key, iv=None) staticmethod

aes_decrypt_mysql(mode, ciphertext, key[, iv])

  • mode — Decryption mode. String
  • ciphertext — Encrypted text that needs to be decrypted. String
  • key — Decryption key. String
  • iv — Optional. Initialization vector. String

Returns the decrypted String. String

aes_encrypt_mysql(mode, plaintext, key, iv=None) staticmethod

aes_encrypt_mysql(mode, plaintext, key[, iv])

  • mode — Encryption mode. String
  • plaintext — Text that should be encrypted. String
  • key — Encryption key. If the key is longer than required by mode, MySQL-specific key folding is performed. String
  • iv — Optional. Initialization vector. Only the first 16 bytes are taken into account. String

Ciphertext binary string. String

age(unit, startdate, enddate, timezone=None) staticmethod

age('unit', startdate, enddate[, timezone])

  • unit — The type of interval for result.
Unit Possible values
nanosecond nanosecond, nanoseconds, ns
microsecond microsecond, microseconds, us, u
millisecond millisecond, milliseconds, ms
second second, seconds, ss, s
minute minute, minutes, mi, n
hour hour, hours, hh, h
day day, days, dd, d
week week, weeks, wk, ww
month month, months, mm, m
quarter quarter, quarters, qq, q
year year, years, yyyy, yy
- startdate — The first time value to subtract (the subtrahend). Date or Date32 or DateTime or DateTime64
- enddate — The second time value to subtract from (the minuend). Date or Date32 or DateTime or DateTime64
- timezone — Optional. Timezone name. If specified, it is applied to both startdate and enddate. If not specified, timezones of startdate and enddate are used. If they are not the same, the result is unspecified. String

Returns the difference between enddate and startdate expressed in unit. Int32

aggThrow(throw_prob) staticmethod

aggThrow(throw_prob)

  • throw_prob — Probability to throw on creation. Float64

Returns an exception: Code: 503. DB::Exception: Aggregate function aggThrow has thrown exception successfully.

alphaTokens(s, max_substrings=None) staticmethod

alphaTokens(s[, max_substrings])

  • s — The string to split. String
  • max_substrings — Optional. When max_substrings > 0, the number of returned substrings will be no more than max_substrings, otherwise the function will return as many substrings as possible. Int64

Returns an array of selected substrings of s. Array(String)

analysisOfVariance(val, group_no) staticmethod

analysisOfVariance(val, group_no)

Returns a tuple with the F-statistic and p-value. Tuple(Float64, Float64)

and_(val1, val2) staticmethod

and(val1, val2[, ...])

Returns: - 0, if at least one argument evaluates to false - NULL, if no argument evaluates to false and at least one argument is NULL - 1, otherwise Nullable(UInt8)

any(column) staticmethod

any(column)[ RESPECT NULLS]

  • column — The column name. Any

Returns the first value encountered. Any

anyHeavy(column) staticmethod

anyHeavy(column)

  • column — The column name. String

Returns a frequently occurring value. The result is nondeterministic. Any

anyLast(column) staticmethod

anyLast(column) [RESPECT NULLS]

  • column — The column name. Any

Returns the last value encountered. Any

anyLast_respect_nulls(*args) staticmethod

any_respect_nulls(*args) staticmethod

appendTrailingCharIfAbsent(s, c) staticmethod

appendTrailingCharIfAbsent(s, c)

  • s — Input string. String
  • c — Character to append if absent. String

Returns string s with character c appended if s does not end with c. String

approx_top_k(N, reserved=None) staticmethod

approx_top_k(N[, reserved])(column)

  • column — The name of the column for which to find the most frequent values. String

Returns an array of the approximately most frequent values and their counts, sorted in descending order of approximate frequency. Array

approx_top_sum(N, reserved=None) staticmethod

approx_top_sum(N[, reserved])(column, weight)

  • column — The name of the column for which to find the most frequent values. String
  • weight — The weight. Every value is accounted weight times for frequency calculation. UInt64

Returns an array of the approximately most frequent values and their counts, sorted in descending order of approximate frequency. Array

areaCartesian(object) staticmethod

areaCartesian(object)

Returns the area of the object. Float64

areaSpherical(object) staticmethod

areaSpherical(object)

Returns the area of the object. Float64

argAndMax(arg, val) staticmethod

argAndMax(arg, val)

Returns a tuple containing the arg value that corresponds to maximum val value and the maximum val value. Tuple

argAndMin(arg, val) staticmethod

argAndMin(arg, val)

Returns a tuple containing the arg value that corresponds to minimum val value and the minimum val value. Tuple

argMax(arg, val) staticmethod

argMax(arg, val)

Returns the arg value that corresponds to maximum val value. Type matches arg type.

argMin(arg, val) staticmethod

argMin(arg, val)

Returns the arg value that corresponds to minimum val value. Type matches arg type.

array(x1, x2=None, xN=None) staticmethod

array(x1 [, x2, ..., xN])

  • x1 — Constant value of any type T. If only this argument is provided, the array will be of type T. - [, x2, ..., xN] — Additional N constant values sharing a common supertype with x1 Returns an array, where 'T' is the smallest common type out of the passed arguments. Array(T)

arrayAUCPR(scores, labels, partial_offsets=None) staticmethod

arrayAUCPR(scores, labels[, partial_offsets])

  • cores — Scores prediction model gives. Array((U)Int*) or Array(Float*)
  • labels — Labels of samples, usually 1 for positive sample and 0 for negative sample. Array((U)Int*) or Array(Enum)
  • partial_offsets
  • Optional. An Array(T) of three non-negative integers for calculating a partial area under the PR curve (equivalent to a vertical band of the PR space) instead of the whole AUC. This option is useful for distributed computation of the PR AUC. The array must contain the following elements [higher_partitions_tp, higher_partitions_fp, total_positives].
    • higher_partitions_tp: The number of positive labels in the higher-scored partitions.
    • higher_partitions_fp: The number of negative labels in the higher-scored partitions.
    • total_positives: The total number of positive samples in the entire dataset.

note When arr_partial_offsets is used, the arr_scores and arr_labels should be only a partition of the entire dataset, containing an interval of scores. The dataset should be divided into contiguous partitions, where each partition contains the subset of the data whose scores fall within a specific range. For example: - One partition could contain all scores in the range [0, 0.5). - Another partition could contain scores in the range [0.5, 1.0].

Returns area under the precision-recall (PR) curve. Float64

arrayAll(func, x, y1=None, yN=None) staticmethod

arrayAll(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • cond1_arr, ... — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns 1 if the lambda function returns true for all elements, 0 otherwise UInt8

arrayAvg(func=None, x=None, y1=None, yN=None) staticmethod

arrayAvg([func(x[, y1, ..., yN])], source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — Optional. A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns the average of elements in the source array, or the average of elements of the lambda results if provided. Float64

arrayCompact(arr) staticmethod

arrayCompact(arr)

  • arr — An array to remove duplicates from. Array(T)

Returns an array without duplicate values Array(T)

arrayConcat(arr1, arr2=None, arrN=None) staticmethod

arrayConcat(arr1 [, arr2, ... , arrN])

  • arr1 [, arr2, ... , arrN] — N number of arrays to concatenate. Array(T)

Returns a single combined array from the provided array arguments. Array(T)

arrayCount(func=None, arr1=None) staticmethod

arrayCount([func, ] arr1, ...)

  • func — Optional. Function to apply to each element of the array(s). Lambda function
  • arr1, ..., arrN — N arrays. Array(T)

Returns the number of elements for which func returns true. Otherwise, returns the number of non-zero elements in the array. UInt32

arrayCumSum(func=None, arr1=None, arr2=None, arrN=None) staticmethod

arrayCumSum([func,] arr1[, arr2, ... , arrN])

  • func — Optional. A lambda function to apply to the array elements at each position. Lambda function
  • arr1 — The source array of numeric values. Array(T)
  • [arr2, ..., arrN] — Optional. Additional arrays of the same size, passed as arguments to the lambda function if specified. Array(T)

Returns an array of the partial sums of the elements in the source array. The result type matches the input array's numeric type. Array(T)

arrayCumSumNonNegative(func=None, arr1=None, arr2=None, arrN=None) staticmethod

arrayCumSumNonNegative([func,] arr1[, arr2, ... , arrN])

  • func — Optional. A lambda function to apply to the array elements at each position. Lambda function
  • arr1 — The source array of numeric values. Array(T)
  • [arr2, ..., arrN] — Optional. Additional arrays of the same size, passed as arguments to the lambda function if specified. Array(T)

Returns an array of the partial sums of the elements in the source array, with any negative running sum replaced by zero. The result type matches the input array's numeric type. Array(T)

arrayDifference(arr) staticmethod

arrayDifference(arr)

  • arr — Array for which to calculate differences between adjacent elements. Array(T)

Returns an array of differences between adjacent array elements UInt*

arrayDistinct(arr) staticmethod

arrayDistinct(arr)

  • arr — Array for which to extract distinct elements. Array(T)

Returns an array containing the distinct elements Array(T)

arrayDotProduct(v1, v2) staticmethod

arrayDotProduct(v1, v2)

The dot product of the two vectors.

note The return type is determined by the type of the arguments. If Arrays or Tuples contain mixed element types then the result type is the supertype.

(U)Int* or Float* or Decimal

arrayElement(arr, n) staticmethod

arrayElement(arr, n)

  • arr — The array to search. Array(T). - n — Position of the element to get. (U)Int*. Returns a single combined array from the provided array arguments Array(T)

arrayElementOrNull(arrays) staticmethod

arrayElementOrNull(arrays)

  • arrays — Arbitrary number of array arguments. Array

Returns a single combined array from the provided array arguments. Array(T)

arrayEnumerate(arr) staticmethod

arrayEnumerate(arr)

  • arr — The array to enumerate. Array

Returns the array [1, 2, 3, ..., length (arr)]. Array(UInt32)

arrayEnumerateDense(arr) staticmethod

arrayEnumerateDense(arr)

  • arr — The array to enumerate. Array(T)

Returns an array of the same size as arr, indicating where each element first appears in the source array Array(T)

arrayEnumerateDenseRanked(clear_depth, arr, max_array_depth) staticmethod

arrayEnumerateDenseRanked(clear_depth, arr, max_array_depth)

  • clear_depth — Enumerate elements at the specified level separately. Must be less than or equal to max_arr_depth. UInt*
  • arr — N-dimensional array to enumerate. Array(T)
  • max_array_depth — The maximum effective depth. Must be less than or equal to the depth of arr. UInt*

Returns an array denoting where each element first appears in the source array Array

arrayEnumerateUniq(arr1, arr2=None, arrN=None) staticmethod

arrayEnumerateUniq(arr1[, arr2, ... , arrN])

  • arr1 — First array to process. Array(T)
  • arr2, ... — Optional. Additional arrays of the same size for tuple uniqueness. Array(UInt32)

Returns an array where each element is the position among elements with the same value or tuple. Array(T)

arrayEnumerateUniqRanked(clear_depth, arr, max_array_depth) staticmethod

arrayEnumerateUniqRanked(clear_depth, arr, max_array_depth)

  • clear_depth — Enumerate elements at the specified level separately. Positive integer less than or equal to max_arr_depth. UInt*
  • arr — N-dimensional array to enumerate. Array(T)
  • max_array_depth — The maximum effective depth. Positive integer less than or equal to the depth of arr. UInt*

Returns an N-dimensional array the same size as arr with each element showing the position of that element in relation to other elements of the same value. Array(T)

arrayExcept(source, except_) staticmethod

arrayExcept(source, except)

  • source — The source array containing elements to filter. Array(T)
  • except — The array containing elements to exclude from the result. Array(T)

Returns an array of the same type as the input array containing elements from source that weren't found in except. Array(T)

arrayExists(func, x, y1=None, yN=None) staticmethod

arrayExists(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns 1 if the lambda function returns true for at least one element, 0 otherwise UInt8

arrayFill(func, x, y1=None, yN=None) staticmethod

arrayFill(func(x [, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x [, y1, ..., yN]) — A lambda function func(x [, y1, y2, ... yN]) → F(x [, y1, y2, ... yN]) which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Lambda function
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns an array Array(T)

arrayFilter(func, x, y1=None, yN=None) staticmethod

arrayFilter(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])]

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns a subset of the source array Array(T)

arrayFirst(func, x, y1=None, yN=None) staticmethod

arrayFirst(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function. - source_arr — The source array to process. Array(T). - [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T). Returns the first element of the source array for which λ is true, otherwise returns the default value of T.

arrayFirstIndex(func, x, y1=None, yN=None) staticmethod

arrayFirstIndex(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function. - source_arr — The source array to process. Array(T). - [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T). Returns the index of the first element of the source array for which func is true, otherwise returns 0 UInt32

arrayFirstOrNull(func, x, y1=None, yN=None) staticmethod

arrayFirstOrNull(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns the first element of the source array for which func is true, otherwise returns NULL.

arrayFlatten(arr) staticmethod

arrayFlatten(arr)

Returns a flattened array from the multidimensional array Array(T)

arrayFold(λ, acc, x1, x2=None, x3=None, xN=None) staticmethod

arrayFold(λ(acc, x1 [, x2, x3, ... xN]), arr1 [, arr2, arr3, ... arrN], acc)

  • λ(x, x1 [, x2, x3, ... xN]) — A lambda function λ(acc, x1 [, x2, x3, ... xN]) → F(acc, x1 [, x2, x3, ... xN]) where F is an operation applied to acc and array values from x with the result of acc re-used. Lambda function
  • arr1 [, arr2, arr3, ... arrN] — N arrays over which to operate. Array(T)
  • acc — Accumulator value with the same type as the return type of the Lambda function. Returns the final acc value.

arrayIntersect(arr, arr1, arrN) staticmethod

arrayIntersect(arr, arr1, ..., arrN)

  • arrN — N arrays from which to make the new array. Array(T). Returns an array with distinct elements that are present in all N arrays Array(T)

arrayJaccardIndex(arr_x, arr_y) staticmethod

arrayJaccardIndex(arr_x, arr_y)

Returns the Jaccard index of arr_x and arr_y Float64

arrayJoin(arr) staticmethod

arrayJoin(arr)

Returns a set of rows unfolded from arr.

arrayLast(func, x, y1=None, yN=None) staticmethod

arrayLast(func(x[, y1, ..., yN]), source[, cond1, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function. - source — The source array to process. Array(T). - [, cond1, ... , condN] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T). Returns the last element of the source array for which func is true, otherwise returns the default value of T.

arrayLastIndex(func, x, y1=None, yN=None) staticmethod

arrayLastIndex(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns the index of the last element of the source array for which func is true, otherwise returns 0 UInt32

arrayLastOrNull(func, x, y1=None, yN=None) staticmethod

arrayLastOrNull(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x [, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function. - source_arr — The source array to process. Array(T). - [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T). Returns the last element of the source array for which λ is not true, otherwise returns NULL.

arrayLevenshteinDistance(from_, to) staticmethod

arrayLevenshteinDistance(from, to)

  • from — The first array. Array(T). - to — The second array. Array(T). Levenshtein distance between the first and the second arrays. Float64

arrayLevenshteinDistanceWeighted(from_, to, from_weights, to_weights) staticmethod

arrayLevenshteinDistanceWeighted(from, to, from_weights, to_weights)

Levenshtein distance between the first and the second arrays with custom weights for each element Float64

arrayMap(func, arr) staticmethod

arrayMap(func, arr)

  • func — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • arr — N arrays to process. Array(T)

Returns an array from the lambda results Array(T)

arrayMax(func=None, x=None, y1=None, yN=None) staticmethod

arrayMax([func(x[, y1, ..., yN])], source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — Optional. A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns the maximum element in the source array, or the maximum element of the lambda results if provided.

arrayMin(func=None, x=None, y1=None, yN=None) staticmethod

arrayMin([func(x[, y1, ..., yN])], source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — Optional. A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • cond1_arr, ... — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns the minimum element in the source array, or the minimum element of the lambda results if provided.

arrayNormalizedGini(predicted, label) staticmethod

arrayNormalizedGini(predicted, label)

  • predicted — The predicted value. Array(T)
  • label — The actual value. Array(T)

A tuple containing the Gini coefficients of the predicted values, the Gini coefficient of the normalized values, and the normalized Gini coefficient (= the ratio of the former two Gini coefficients) Tuple(Float64, Float64, Float64)

arrayPartialReverseSort(f=None, arr=None, arr1=None, arrN=None, limit=None) staticmethod

arrayPartialReverseSort([f,] arr [, arr1, ... ,arrN], limit)

  • f(arr[, arr1, ... ,arrN]) — The lambda function to apply to elements of array x. Lambda function
  • arr — Array to be sorted. Array(T)
  • arr1, ... ,arrN — N additional arrays, in the case when f accepts multiple arguments. Array(T)
  • limit — Index value up until which sorting will occur. (U)Int*

Returns an array of the same size as the original array where elements in the range [1..limit] are sorted in descending order. The remaining elements (limit..N] are in an unspecified order.

arrayPartialShuffle(arr, limit=None, seed=None) staticmethod

arrayPartialShuffle(arr [, limit[, seed]])

  • arr — The array to shuffle. Array(T)
  • seed — Optional. The seed to be used with random number generation. If not provided, a random one is used. (U)Int*
  • limit — Optional. The number to limit element swaps to, in the range [1..N]. (U)Int*

Array with elements partially shuffled. Array(T)

arrayPartialSort(f=None, arr=None, arr1=None, arrN=None, limit=None) staticmethod

arrayPartialSort([f,] arr [, arr1, ... ,arrN], limit)

  • f(arr[, arr1, ... ,arrN]) — The lambda function to apply to elements of array x. Lambda function
  • arr — Array to be sorted. Array(T)
  • arr1, ... ,arrN — N additional arrays, in the case when f accepts multiple arguments. Array(T)
  • limit — Index value up until which sorting will occur. (U)Int*

Returns an array of the same size as the original array where elements in the range [1..limit] are sorted in ascending order. The remaining elements (limit..N] are in an unspecified order.

arrayPopBack(arr) staticmethod

arrayPopBack(arr)

  • arr — The array for which to remove the last element from. Array(T)

Returns an array identical to arr but without the last element of arr Array(T)

arrayPopFront(arr) staticmethod

arrayPopFront(arr)

  • arr — The array for which to remove the first element from. Array(T)

Returns an array identical to arr but without the first element of arr Array(T)

arrayProduct(func=None, x=None, y1=None, yN=None) staticmethod

arrayProduct([func(x[, y1, ..., yN])], source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — Optional. A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns the product of elements in the source array, or the product of elements of the lambda results if provided. Float64

arrayPushBack(arr, x) staticmethod

arrayPushBack(arr, x)

  • arr — The array for which to add value x to the end of. Array(T)
  • x
  • Single value to add to the end of the array. Array(T).

note - Only numbers can be added to an array with numbers, and only strings can be added to an array of strings. - When adding numbers, ClickHouse automatically sets the type of x for the data type of the array. - Can be NULL. The function adds a NULL element to an array, and the type of array elements converts to Nullable.

For more information about the types of data in ClickHouse, see Data types.

Returns an array identical to arr but with an additional value x at the end of the array Array(T)

arrayPushFront(arr, x) staticmethod

arrayPushFront(arr, x)

  • arr — The array for which to add value x to the end of. Array(T). - x
  • Single value to add to the start of the array. Array(T).

note - Only numbers can be added to an array with numbers, and only strings can be added to an array of strings. - When adding numbers, ClickHouse automatically sets the type of x for the data type of the array. - Can be NULL. The function adds a NULL element to an array, and the type of array elements converts to Nullable.

For more information about the types of data in ClickHouse, see Data types.

Returns an array identical to arr but with an additional value x at the beginning of the array Array(T)

arrayROCAUC(scores, labels, scale=None, partial_offsets=None) staticmethod

arrayROCAUC(scores, labels[, scale[, partial_offsets]])

  • scores — Scores prediction model gives. Array((U)Int*) or Array(Float*)
  • labels — Labels of samples, usually 1 for positive sample and 0 for negative sample. Array((U)Int*) or Enum
  • scale — Optional. Decides whether to return the normalized area. If false, returns the area under the TP (true positives) x FP (false positives) curve instead. Default value: true. Bool
  • partial_offsets
  • An array of four non-negative integers for calculating a partial area under the ROC curve (equivalent to a vertical band of the ROC space) instead of the whole AUC. This option is useful for distributed computation of the ROC AUC. The array must contain the following elements [higher_partitions_tp, higher_partitions_fp, total_positives, total_negatives]. Array of non-negative Integers. Optional.
    • higher_partitions_tp: The number of positive labels in the higher-scored partitions.
    • higher_partitions_fp: The number of negative labels in the higher-scored partitions.
    • total_positives: The total number of positive samples in the entire dataset.
    • total_negatives: The total number of negative samples in the entire dataset.

note When arr_partial_offsets is used, the arr_scores and arr_labels should be only a partition of the entire dataset, containing an interval of scores. The dataset should be divided into contiguous partitions, where each partition contains the subset of the data whose scores fall within a specific range. For example: - One partition could contain all scores in the range [0, 0.5). - Another partition could contain scores in the range [0.5, 1.0].

Returns area under the receiver operating characteristic (ROC) curve. Float64

arrayRandomSample(arr, samples) staticmethod

arrayRandomSample(arr, samples)

  • arr — The input array or multidimensional array from which to sample elements. Array(T)
  • samples — The number of elements to include in the random sample. (U)Int*

An array containing a random sample of elements from the input array Array(T)

arrayReduce(agg_f, arr1, arr2=None, arrN=None) staticmethod

arrayReduce(agg_f, arr1 [, arr2, ... , arrN)])

  • agg_f — The name of an aggregate function which should be a constant. String
  • arr1 [, arr2, ... , arrN)] — N arrays corresponding to the arguments of agg_f. Array(T)

Returns the result of the aggregate function

arrayReduceInRanges(agg_f, ranges, arr1, arr2=None, arrN=None) staticmethod

arrayReduceInRanges(agg_f, ranges, arr1 [, arr2, ... ,arrN)])

  • agg_f — The name of the aggregate function to use. String
  • ranges — The range over which to aggregate. An array of tuples, (i, r) containing the index i from which to begin from and the range r over which to aggregate. Array(T) or Tuple(T)
  • arr1 [, arr2, ... ,arrN)] — N arrays as arguments to the aggregate function. Array(T)

Returns an array containing results of the aggregate function over the specified ranges Array(T)

arrayRemove(arr, elem) staticmethod

arrayRemove(arr, elem)

  • arr — Array(T) - elem — T Returns a subset of the source array Array(T)

arrayResize(arr, size, extender=None) staticmethod

arrayResize(arr, size[, extender])

  • arr — Array to resize. Array(T)
  • size — -The new length of the array. If size is less than the original size of the array, the array is truncated from the right. If size is larger than the initial size of the array, the array is extended to the right with extender values or default values for the data type of the array items.
  • extender — Value to use for extending the array. Can be NULL. An array of length size. Array(T)

arrayReverse(arr) staticmethod

arrayReverse(arr)

  • arr — The array to reverse. Array(T)

Returns an array of the same size as the original array containing the elements in reverse order Array(T)

arrayReverseFill(func, x, y1=None, yN=None) staticmethod

arrayReverseFill(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns an array with elements of the source array replaced by the results of the lambda. Array(T)

arrayReverseSort(f=None, arr=None, arr1=None, arrN=None) staticmethod

arrayReverseSort([f,] arr [, arr1, ... ,arrN)

  • f(y1[, y2 ... yN]) — The lambda function to apply to elements of array x. - arr — An array to be sorted. Array(T) - arr1, ..., yN — Optional. N additional arrays, in the case when f accepts multiple arguments. Returns the array x sorted in descending order if no lambda function is provided, otherwise it returns an array sorted according to the logic of the provided lambda function, and then reversed. Array(T).

arrayReverseSplit(func, x, y1=None, yN=None) staticmethod

arrayReverseSplit(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Lambda function
  • [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns an array of arrays. Array(Array(T))

arrayRotateLeft(arr, n) staticmethod

arrayRotateLeft(arr, n)

  • arr — The array for which to rotate the elements.Array(T). - n — Number of elements to rotate. (U)Int8/16/32/64. An array rotated to the left by the specified number of elements Array(T)

arrayRotateRight(arr, n) staticmethod

arrayRotateRight(arr, n)

  • arr — The array for which to rotate the elements.Array(T). - n — Number of elements to rotate. (U)Int8/16/32/64. An array rotated to the right by the specified number of elements Array(T)

arrayShiftLeft(arr, n, default=None) staticmethod

arrayShiftLeft(arr, n[, default])

  • arr — The array for which to shift the elements.Array(T). - n — Number of elements to shift.(U)Int8/16/32/64. - default — Optional. Default value for new elements. An array shifted to the left by the specified number of elements Array(T)

arrayShiftRight(arr, n, default=None) staticmethod

arrayShiftRight(arr, n[, default])

  • arr — The array for which to shift the elements. Array(T)
  • n — Number of elements to shift. (U)Int8/16/32/64
  • default — Optional. Default value for new elements. An array shifted to the right by the specified number of elements Array(T)

arrayShuffle(arr, seed=None) staticmethod

arrayShuffle(arr [, seed])

  • arr — The array to shuffle. Array(T)
  • seed (optional) — Optional. The seed to be used with random number generation. If not provided a random one is used. (U)Int*

Array with elements shuffled Array(T)

arraySimilarity(from_, to, from_weights, to_weights) staticmethod

arraySimilarity(from, to, from_weights, to_weights)

Returns the similarity between 0 and 1 of the two arrays based on the weighted Levenshtein distance Float64

arraySlice(arr, offset, length=None) staticmethod

arraySlice(arr, offset [, length])

  • arr — Array to slice. Array(T)
  • offset — Indent from the edge of the array. A positive value indicates an offset on the left, and a negative value is an indent on the right. Numbering of the array items begins with 1. (U)Int*
  • length — The length of the required slice. If you specify a negative value, the function returns an open slice [offset, array_length - length]. If you omit the value, the function returns the slice [offset, the_end_of_array]. (U)Int*

Returns a slice of the array with length elements from the specified offset Array(T)

arraySort(f=None, arr=None, arr1=None, arrN=None) staticmethod

arraySort([f,] arr [, arr1, ... ,arrN])

  • f(y1[, y2 ... yN]) — The lambda function to apply to elements of array x. - arr — An array to be sorted. Array(T) - arr1, ..., yN — Optional. N additional arrays, in the case when f accepts multiple arguments. Returns the array arr sorted in ascending order if no lambda function is provided, otherwise it returns an array sorted according to the logic of the provided lambda function. Array(T).

arraySplit(func, x, y1=None, yN=None) staticmethod

arraySplit(func(x[, y1, ..., yN]), source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — A lambda function which operates on elements of the source array (x) and condition arrays (y).Lambda function. - source_arr — The source array to split Array(T). - [, cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T). Returns an array of arrays Array(Array(T))

arrayStringConcat(arr, separator=None) staticmethod

arrayStringConcat(arr[, separator])

  • arr — The array to concatenate. Array(T)
  • separator — Optional. Separator string. By default an empty string. const String

Returns the concatenated string. String

arraySum(func=None, x=None, y1=None, yN=None) staticmethod

arraySum([func(x[, y1, ..., yN])], source_arr[, cond1_arr, ... , condN_arr])

  • func(x[, y1, ..., yN]) — Optional. A lambda function which operates on elements of the source array (x) and condition arrays (y). Lambda function
  • source_arr — The source array to process. Array(T)
  • , cond1_arr, ... , condN_arr] — Optional. N condition arrays providing additional arguments to the lambda function. Array(T)

Returns the sum of elements in the source array, or the sum of elements of the lambda results if provided.

arraySymmetricDifference(arr1, arr2, arrN) staticmethod

arraySymmetricDifference(arr1, arr2, ... , arrN)

  • arrN — N arrays from which to make the new array. Array(T). Returns an array of distinct elements not present in all source arrays Array(T)

arrayUnion(arr1, arr2, arrN) staticmethod

arrayUnion(arr1, arr2, ..., arrN)

  • arrN — N arrays from which to make the new array. Array(T)

Returns an array with distinct elements from the source arrays Array(T)

arrayUniq(arr1, arr2=None, arrN=None) staticmethod

arrayUniq(arr1[, arr2, ..., arrN])

  • arr1 — Array for which to count the number of unique elements. Array(T)
  • [, arr2, ..., arrN] — Optional. Additional arrays used to count the number of unique tuples of elements at corresponding positions in multiple arrays. Array(T)

For a single argument returns the number of unique elements. For multiple arguments returns the number of unique tuples made from elements at corresponding positions across the arrays. UInt32

arrayWithConstant(N, x) staticmethod

arrayWithConstant(N, x)

  • length — Number of elements in the array. (U)Int*
  • x — The value of the N elements in the array, of any type. Returns an Array with N elements of value x. Array(T)

arrayZip(arr1, arr2, arrN) staticmethod

arrayZip(arr1, arr2, ... , arrN)

  • arr1, arr2, ... , arrN — N arrays to combine into a single array. Array(T)

Returns an array with elements from the source arrays grouped in tuples. Data types in the tuple are the same as types of the input arrays and in the same order as arrays are passed Array(T)

arrayZipUnaligned(arr1, arr2, arrN) staticmethod

arrayZipUnaligned(arr1, arr2, ..., arrN)

  • arr1, arr2, ..., arrN — N arrays to combine into a single array. Array(T)

Returns an array with elements from the source arrays grouped in tuples. Data types in the tuple are the same as types of the input arrays and in the same order as arrays are passed. Array(T) or Tuple(T1, T2, ...)

ascii(s) staticmethod

ascii(s)

Returns the ASCII code point of the first character. If s is empty, the result is 0. If the first character is not an ASCII character or not part of the Latin-1 supplement range of UTF-16, the result is undefined. Int32

asin(x) staticmethod

asin(x)

Returns the arcsine value of the provided argument x Float64

asinh(x) staticmethod

asinh(x)

  • x — Hyperbolic sine of angle. Values from the interval: -∞ < x < +∞. (U)Int* or Float* or Decimal*

Returns the angle, in radians. Values from the interval: -∞ < asinh(x) < +∞. Float64

assumeNotNull(x) staticmethod

assumeNotNull(x)

  • x — The original value of any nullable type. Nullable(T)

Returns the non-nullable value, if the original value was not NULL, otherwise an arbitrary value, if the input value is NULL. Any

atan(x) staticmethod

atan(x)

Returns the arc tangent of x. Float*

atan2(y, x) staticmethod

atan2(y, x)

Returns the angle θ such that -π < θ ≤ π, in radians Float64

atanh(x) staticmethod

atanh(x)

  • x — Hyperbolic tangent of angle. Values from the interval: -1 < x < 1. (U)Int*, Float* or Decimal*. (U)Int* or Float* or Decimal*

Returns the angle, in radians. Values from the interval: -∞ < atanh(x) < +∞ Float64

authenticatedUser() staticmethod

authenticatedUser()

The name of the authenticated user. String

avg(x) staticmethod

avg(x)

Returns the arithmetic mean, otherwise returns NaN if the input parameter x is empty. Float64

avg2(x1, x2) staticmethod

avg2(x1, x2])

  • x1, x2] — Accepts two values for averaging. Returns the average value of the provided arguments, promoted to the largest compatible type.

avgWeighted(x, weight) staticmethod

avgWeighted(x, weight)

Returns NaN if all the weights are equal to 0 or the supplied weights parameter is empty, or the weighted mean otherwise. Float64

bar(x, min, max, width=None) staticmethod

bar(x, min, max[, width])

Returns a unicode-art bar string. String

base32Decode(encoded) staticmethod

base32Decode(encoded)

  • encoded — String column or constant. String

Returns a string containing the decoded value of the argument. String

base32Encode(plaintext) staticmethod

base32Encode(plaintext)

  • plaintext — Plaintext to encode. String

Returns a string containing the encoded value of the argument. String or FixedString

base58Decode(encoded) staticmethod

base58Decode(encoded)

  • encoded — String column or constant to decode. String

Returns a string containing the decoded value of the argument. String

base58Encode(plaintext) staticmethod

base58Encode(plaintext)

  • plaintext — Plaintext to encode. String

Returns a string containing the encoded value of the argument. String

base64Decode(encoded) staticmethod

base64Decode(encoded)

  • encoded — String column or constant to decode. If the string is not valid Base64-encoded, an exception is thrown. String

Returns the decoded string. String

base64Encode(plaintext) staticmethod

base64Encode(plaintext)

  • plaintext — Plaintext column or constant to decode. String

Returns a string containing the encoded value of the argument. String

base64URLDecode(encoded) staticmethod

base64URLDecode(encoded)

  • encoded — String column or constant to encode. If the string is not valid Base64-encoded, an exception is thrown. String

Returns a string containing the decoded value of the argument. String

base64URLEncode(plaintext) staticmethod

base64URLEncode(plaintext)

  • plaintext — Plaintext column or constant to encode. String

Returns a string containing the encoded value of the argument. String

basename(expr) staticmethod

basename(expr)

  • expr — A string expression. Backslashes must be escaped. String

Returns the tail of the input string after its last slash or backslash. If the input string ends with a slash or backslash, the function returns an empty string. Returns the original string if there are no slashes or backslashes. String

bech32Decode(address) staticmethod

bech32Decode(address)

Returns a tuple consisting of (hrp, data) that was used to encode the string. The data is in binary format. Tuple(String, String)

bech32Encode(hrp, data, witver=None) staticmethod

bech32Encode(hrp, data[, witver])

  • hrp — A String of 1 - 83 lowercase characters specifying the "human-readable part" of the code. Usually 'bc' or 'tb'. String or FixedString
  • data — A String of binary data to encode. String or FixedString
  • witver — Optional. The witness version (default = 1). An UInt* specifying the version of the algorithm to run. 0 for Bech32 and 1 or greater for Bech32m. UInt*

Returns a Bech32 address string, consisting of the human-readable part, a separator character which is always '1', and a data part. The length of the string will never exceed 90 characters. If the algorithm cannot generate a valid address from the input, it will return an empty string. String

bin(arg) staticmethod

bin(arg)

Returns a string with the binary representation of the argument. String

bitAnd(a, b) staticmethod

bitAnd(a, b)

Returns the result of bitwise operation a AND b

bitCount(x) staticmethod

bitCount(x)

Returns the number of bits set to one in x. UInt8.

note The function does not convert the input value to a larger type (sign extension). For example: bitCount(toUInt8(-1)) = 8.

bitHammingDistance(x, y) staticmethod

bitHammingDistance(x, y)

  • x — First number for Hamming distance calculation. (U)Int* or Float*
  • y — Second number for Hamming distance calculation. (U)Int* or Float*

Returns the hamming distance between x and y UInt8

bitNot(a) staticmethod

bitNot(a)

Returns the result of ~a i.e a with bits flipped.

bitOr(a, b) staticmethod

bitOr(a, b)

Returns the result of bitwise operation a OR b

bitPositionsToArray(arg) staticmethod

bitPositionsToArray(arg)

  • arg — An integer value. (U)Int*

Returns an array with the ascendingly ordered positions of 1 bits in the binary representation of the input. Array(UInt64)

bitRotateLeft(a, N) staticmethod

bitRotateLeft(a, N)

Returns the rotated value with type equal to that of a. (U)Int8/16/32/64

bitRotateRight(a, N) staticmethod

bitRotateRight(a, N)

Returns the rotated value with type equal to that of a. (U)Int8/16/32/64

bitShiftLeft(a, N) staticmethod

bitShiftLeft(a, N)

Returns the shifted value with type equal to that of a.

bitShiftRight(a, N) staticmethod

bitShiftRight(a, N)

Returns the shifted value with type equal to that of a.

bitSlice(s, offset, length=None) staticmethod

bitSlice(s, offset[, length])

  • s — The String or Fixed String to slice. String or FixedString
  • offset — Returns the starting bit position (1-based indexing).
  • Positive values: count from the beginning of the string.
  • Negative values: count from the end of the string.
     [`(U)Int8/16/32/64`](https://clickhouse.com/docs/sql-reference/data-types/int-uint) or [`Float*`](https://clickhouse.com/docs/sql-reference/data-types/float)
    
    • length — Optional. The number of bits to extract.
    • Positive values: extract length bits.
    • Negative values: extract from the offset to (string_length - |length|).
    • Omitted: extract from offset to end of string.
    • If length is not a multiple of 8, the result is padded with zeros on the right. (U)Int8/16/32/64 or Float*

Returns a string containing the extracted bits, represented as a binary sequence. The result is always padded to byte boundaries (multiples of 8 bits) String

bitTest(a, i) staticmethod

bitTest(a, i)

Returns the value of the bit at position i in the binary representation of a UInt8

bitTestAll(a, index1, index2=None, indexN=None) staticmethod

bitTestAll(a, index1[, index2, ... , indexN])

Returns the result of the logical conjunction UInt8

bitTestAny(a, index1, index2=None, indexN=None) staticmethod

bitTestAny(a, index1[, index2, ... , indexN])

Returns the result of the logical disjunction UInt8

bitXor(a, b) staticmethod

bitXor(a, b)

Returns the result of bitwise operation a XOR b

bitmapAnd(bitmap1, bitmap2) staticmethod

bitmapAnd(bitmap1, bitmap2)

bitmapAndCardinality(bitmap1, bitmap2) staticmethod

bitmapAndCardinality(bitmap1, bitmap2)

bitmapAndnot(bitmap1, bitmap2) staticmethod

bitmapAndnot(bitmap1, bitmap2)

bitmapAndnotCardinality(bitmap1, bitmap2) staticmethod

bitmapAndnotCardinality(bitmap1, bitmap2)

bitmapBuild(array) staticmethod

bitmapBuild(array)

Returns a bitmap from the provided array AggregateFunction(groupBitmap, T)

bitmapCardinality(bitmap) staticmethod

bitmapCardinality(bitmap)

bitmapContains(bitmap, value) staticmethod

bitmapContains(bitmap, value)

bitmapHasAll(bitmap1, bitmap2) staticmethod

bitmapHasAll(bitmap1, bitmap2)

bitmapHasAny(bitmap1, bitmap2) staticmethod

bitmapHasAny(bitmap1, bitmap2)

bitmapMax(bitmap) staticmethod

bitmapMax(bitmap)

bitmapMin(bitmap) staticmethod

bitmapMin(bitmap)

bitmapOr(bitmap1, bitmap2) staticmethod

bitmapOr(bitmap1, bitmap2)

bitmapOrCardinality(bitmap1, bitmap2) staticmethod

bitmapOrCardinality(bitmap1, bitmap2)

bitmapSubsetInRange(bitmap, start, end) staticmethod

bitmapSubsetInRange(bitmap, start, end)

bitmapSubsetLimit(bitmap, range_start, cardinality_limit) staticmethod

bitmapSubsetLimit(bitmap, range_start, cardinality_limit)

bitmapToArray(bitmap) staticmethod

bitmapToArray(bitmap)

bitmapTransform(bitmap, from_array, to_array) staticmethod

bitmapTransform(bitmap, from_array, to_array)

bitmapXor(bitmap1, bitmap2) staticmethod

bitmapXor(bitmap1, bitmap2)

bitmapXorCardinality(bitmap1, bitmap2) staticmethod

bitmapXorCardinality(bitmap1, bitmap2)

bitmaskToArray(num) staticmethod

bitmaskToArray(num)

  • num — An integer value. (U)Int*

Returns an array with the ascendingly ordered powers of two which sum up to the input number. Array(UInt64)

bitmaskToList(num) staticmethod

bitmaskToList(num)

  • num — An integer value. (U)Int*

Returns a string containing comma-separated powers of two. String

blockNumber() staticmethod

blockNumber()

Sequence number of the data block where the row is located. UInt64

blockSerializedSize(x1, x2=None) staticmethod

blockSerializedSize(x1[, x2[, ...]])

  • x1[, x2, ...] — Any number of values for which to get the uncompressed size of the block. Any

Returns the number of bytes that will be written to disk for a block of values without compression. UInt64

blockSize() staticmethod

blockSize()

Returns the number of rows in the current block. UInt64

boundingRatio(x, y) staticmethod

boundingRatio(x, y)

Returns the slope of the line between the leftmost and rightmost points, otherwise returns NaN if the data is empty. Float64

buildId() staticmethod

buildId()

Returns the build ID. String

byteHammingDistance(s1, s2) staticmethod

byteHammingDistance(s1, s2)

  • s1 — First input string. String
  • s2 — Second input string. String

Returns the Hamming distance between the two strings. UInt64

byteSize(arg1, arg2=None) staticmethod

byteSize(arg1[, arg2, ...])

  • arg1[, arg2, ...] — Values of any data type for which to estimate the uncompressed byte size. Any

Returns an estimation of the byte size of the arguments in memory. UInt64

byteSwap(x) staticmethod

byteSwap(x)

Returns x with bytes reversed. (U)Int*

caseFoldUTF8(str) staticmethod

caseFoldUTF8(str)

  • str — UTF-8 encoded input string. String

Case-folded UTF-8 string. String

caseWithExpression(*args) staticmethod

catboostEvaluate(path_to_model, feature_1, feature_2=None, feature_n=None) staticmethod

catboostEvaluate(path_to_model, feature_1[, feature_2, ..., feature_n])

  • path_to_model — Path to catboost model. const String
  • feature — One or more model features/arguments. Float*

Returns the model evaluation result. Float64

categoricalInformationValue(category1, category2=None, tag=None) staticmethod

categoricalInformationValue(category1[, category2, ...,]tag)

  • category1, category2, ... — One or more categorical features to analyze. Each category should contain discrete values. UInt8
  • tag — Binary target variable for prediction. Should contain values 0 and 1. UInt8

Returns an array of Float64 values representing the information value for each unique combination of categories. Each value indicates the predictive strength of that category combination for the target variable. Array(Float64)

cbrt(x) staticmethod

cbrt(x)

Returns the cubic root of x. Float*

ceil(x, N=None) staticmethod

ceiling(x[, N])

  • x — The value to round. Float* or Decimal* or (U)Int*
  • N — Optional. The number of decimal places to round to. Defaults to zero, which means rounding to an integer. Can be negative. (U)Int*

Returns a rounded number of the same type as x. Float* or Decimal* or (U)Int*

changeDay(date_or_datetime, value) staticmethod

changeDay(date_or_datetime, value)

Returns a value of the same type as date_or_datetime with modified day component. Date or Date32 or DateTime or DateTime64

changeHour(date_or_datetime, value) staticmethod

changeHour(date_or_datetime, value)

Returns a value of the same type as date_or_datetime with modified hour component. DateTime or DateTime64

changeMinute(date_or_datetime, value) staticmethod

changeMinute(date_or_datetime, value)

Returns a value of the same type as date_or_datetime with modified minute component. DateTime or DateTime64

changeMonth(date_or_datetime, value) staticmethod

changeMonth(date_or_datetime, value)

Returns a value of the same type as date_or_datetime with modified month component. Date or Date32 or DateTime or DateTime64

changeSecond(date_or_datetime, value) staticmethod

changeSecond(date_or_datetime, value)

Returns a value of the same type as date_or_datetime with modified seconds component. DateTime or DateTime64

changeYear(date_or_datetime, value) staticmethod

changeYear(date_or_datetime, value)

Returns a value of the same type as date_or_datetime with modified year component. Date or Date32 or DateTime or DateTime64

char(num1, num2=None) staticmethod

char(num1[, num2[, ...]])

Returns a string of the given bytes. String

cityHash64(arg1, arg2=None) staticmethod

cityHash64(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed hash of the input arguments. UInt64

clamp(value, min, max) staticmethod

clamp(value, min, max)

  • value — The value to clamp. - min — The minimum bound. - max — The maximum bound. Returns the value, restricted to the [min, max] range.

coalesce(x, y=None) staticmethod

coalesce(x[, y, ...])

  • x[, y, ...] — Any number of parameters of non-compound type. All parameters must be of mutually compatible data types. Any

Returns the first non-NULL argument, otherwise NULL, if all arguments are NULL. Any or NULL

colorOKLABToSRGB(tuple, gamma=None) staticmethod

colorOKLABToSRGB(tuple [, gamma])

  • tuple — A tuple of three numeric values L, a, b, where L is in the range [0...1]. Tuple(Float64, Float64, Float64)
  • gamma — Optional. The exponent that is used to transform linear sRGB back to sRGB by applying (x ^ (1 / gamma)) * 255 for each channel x. Defaults to 2.2. Float64

Returns a tuple (R, G, B) representing sRGB color values. Tuple(Float64, Float64, Float64)

colorOKLCHToSRGB(tuple, gamma=None) staticmethod

colorOKLCHToSRGB(tuple [, gamma])

  • tuple — A tuple of three numeric values L, C, H, where L is in the range [0...1], C >= 0 and H is in the range [0...360]. Tuple(Float64, Float64, Float64)
  • gamma — Optional. The exponent that is used to transform linear sRGB back to sRGB by applying (x ^ (1 / gamma)) * 255 for each channel x. Defaults to 2.2. Float64

Returns a tuple (R, G, B) representing sRGB color values. Tuple(Float64, Float64, Float64)

colorSRGBToOKLAB(tuple, gamma=None) staticmethod

colorSRGBToOKLAB(tuple[, gamma])

  • tuple — Tuple of three values R, G, B in the range [0...255]. Tuple(UInt8, UInt8, UInt8)
  • gamma — Optional. Exponent that is used to linearize sRGB by applying (x / 255)^gamma to each channel x. Defaults to 2.2. Float64

Returns a tuple (L, a, b) representing the OKLAB color space values. Tuple(Float64, Float64, Float64)

colorSRGBToOKLCH(tuple, gamma=None) staticmethod

colorSRGBToOKLCH(tuple[, gamma])

  • tuple — Tuple of three values R, G, B in the range [0...255]. Tuple(UInt8, UInt8, UInt8)
  • gamma — Optional. Exponent that is used to linearize sRGB by applying (x / 255)^gamma to each channel x. Defaults to 2.2. Float64

Returns a tuple (L, C, H) representing the OKLCH color space values. Tuple(Float64, Float64, Float64)

compareSubstrings(s1, s2, s1_offset, s2_offset, num_bytes) staticmethod

compareSubstrings(s1, s2, s1_offset, s2_offset, num_bytes)

  • s1 — The first string to compare. String
  • s2 — The second string to compare. String
  • s1_offset — The position (zero-based) in s1 from which the comparison starts. UInt*
  • s2_offset — The position (zero-based index) in s2 from which the comparison starts. UInt*
  • num_bytes — The maximum number of bytes to compare in both strings. If s1_offset (or s2_offset) + num_bytes exceeds the end of an input string, num_bytes will be reduced accordingly. UInt*

Returns: - -1 if s1[s1_offset : s1_offset + num_bytes] < s2[s2_offset : s2_offset + num_bytes]. - 0 if s1[s1_offset : s1_offset + num_bytes] = s2[s2_offset : s2_offset + num_bytes]. - 1 if s1[s1_offset : s1_offset + num_bytes] > s2[s2_offset : s2_offset + num_bytes]. Int8

concat(s1=None, s2=None) staticmethod

concat([s1, s2, ...])

  • s1, s2, ... — Any number of values of arbitrary type. Any

Returns the String created by concatenating the arguments. If any of arguments is NULL, the function returns NULL. If there are no arguments, it returns an empty string. Nullable(String)

concatAssumeInjective(s1=None, s2=None) staticmethod

concatAssumeInjective([s1, s2, ...])

Returns the string created by concatenating the arguments. If any of argument values is NULL, the function returns NULL. If no arguments are passed, it returns an empty string. String

concatWithSeparator(sep, exp1=None, exp2=None) staticmethod

concatWithSeparator(sep[, exp1, exp2, ...])

  • sep — The separator to use. const String or const FixedString
  • exp1, exp2, ... — Expression to be concatenated. Arguments which are not of type String or FixedString are converted to strings using their default serialization. As this decreases performance, it is not recommended to use non-String/FixedString arguments. Any

Returns the String created by concatenating the arguments. If any of the argument values is NULL, the function returns NULL. String

concatWithSeparatorAssumeInjective(sep, exp1=None, exp2=None) staticmethod

concatWithSeparatorAssumeInjective(sep[, exp1, exp2, ... ])

  • sep — The separator to use. const String or const FixedString
  • exp1, exp2, ... — Expression to be concatenated. Arguments which are not of type String or FixedString are converted to strings using their default serialization. As this decreases performance, it is not recommended to use non-String/FixedString arguments. String or FixedString

Returns the String created by concatenating the arguments. If any of the argument values is NULL, the function returns NULL. String

connectionId() staticmethod

connectionId()

Returns the connection ID of the current client. UInt64

contingency(column1, column2) staticmethod

contingency(column1, column2)

  • column1 — First column to compare. Any
  • column2 — Second column to compare. Any

Returns a value between 0 and 1. The larger the result, the closer the association of the two columns. Float64

conv(number, from_base, to_base) staticmethod

conv(number, from_base, to_base)

  • number — The number to convert. Can be a string or numeric type. - from_base — The source base (2-36). Must be an integer. - to_base — The target base (2-36). Must be an integer. String representation of the number in the target base.

convertCharset(s, from_, to) staticmethod

convertCharset(s, from, to)

  • s — Input string. String
  • from — Source character encoding. String
  • to — Target character encoding. String

Returns string s converted from encoding from to encoding to. String

corr(x, y) staticmethod

corr(x, y)

Returns the Pearson correlation coefficient. Float64

corrMatrix(x1, x2=None) staticmethod

corrMatrix(x1[, x2, ...])

  • x1[, x2, ...] — One or more parameters for which to compute the correlation matrix over. (U)Int8/16/32/64 or Float*

Returns the correlation matrix. Array(Array(Float64))

corrStable(x, y) staticmethod

corrStable(x, y)

Returns the Pearson correlation coefficient. Float64

cos(x) staticmethod

cos(x)

Returns the cosine of x. Float*

cosh(x) staticmethod

cosh(x)

Returns values from the interval: 1 ≤ cosh(x) < +∞ Float64

cosineDistance(vector1, vector2) staticmethod

cosineDistance(vector1, vector2)

Returns the cosine of the angle between two vectors subtracted from one. Float64

cosineDistanceTransposed(vector1, vector2, p) staticmethod

cosineDistanceTransposed(vector1, vector2, p)

  • vectors — Vectors. QBit(T, UInt64)
  • reference — Reference vector. Array(T)
  • p — Number of bits from each vector element to use in the distance calculation (1 to element bit-width). The quantization level controls the precision-speed trade-off. Using fewer bits results in faster I/O and calculations with reduced accuracy, while using more bits increases accuracy at the cost of performance. UInt

Returns the approximate cosine of the angle between two vectors subtracted from one. Float64

count(expr=None) staticmethod

count([expr])

  • expr — Optional. An expression. The function counts how many times this expression returned not null. Expression

Returns the a row count if the function is called without parameters, otherwise returns a count of how many times the passed expression returned not null. UInt64

countDigits(x) staticmethod

countDigits(x)

Returns the number of digits needed to represent x. UInt8

countEqual(arr, x) staticmethod

countEqual(arr, x)

  • arr — Array to search. Array(T)
  • x — Value in the array to count. Any type. Returns the number of elements in the array equal to x UInt64

countMatches(haystack, pattern) staticmethod

countMatches(haystack, pattern)

  • haystack — The string to search in. String
  • pattern — Regular expression pattern. String

Returns the number of matches found. UInt64

countMatchesCaseInsensitive(haystack, pattern) staticmethod

countMatchesCaseInsensitive(haystack, pattern)

  • haystack — The string to search in. String
  • pattern — Regular expression pattern. const String

Returns the number of matches found. UInt64

countSubstrings(haystack, needle, start_pos=None) staticmethod

countSubstrings(haystack, needle[, start_pos])

  • haystack — String in which the search is performed. String or Enum. - needle — Substring to be searched. String. - start_pos — Position (1-based) in haystack at which the search starts. UInt. Optional. The number of occurrences. UInt64

countSubstringsCaseInsensitive(haystack, needle, start_pos=None) staticmethod

countSubstringsCaseInsensitive(haystack, needle[, start_pos])

  • haystack — String in which the search is performed. String or Enum
  • needle — Substring to be searched. String
  • start_pos — Optional. Position (1-based) in haystack at which the search starts. UInt*

Returns the number of occurrences of the neddle in the haystack. UInt64

countSubstringsCaseInsensitiveUTF8(haystack, needle, start_pos=None) staticmethod

countSubstringsCaseInsensitiveUTF8(haystack, needle[, start_pos])

  • haystack — UTF-8 string in which the search is performed. String or Enum
  • needle — Substring to be searched. String
  • start_pos — Optional. Position (1-based) in haystack at which the search starts. UInt*

Returns the number of occurrences of the needle in the haystack. UInt64

covarPop(x, y) staticmethod

covarPop(x, y)

Returns the population covariance between x and y. Float64

covarPopMatrix(x1, x2=None) staticmethod

covarPopMatrix(x1[, x2, ...])

Returns the population covariance matrix. Array(Array(Float64))

covarPopStable(x, y) staticmethod

covarPopStable(x, y)

Returns the population covariance between x and y. Float64

covarSamp(x, y) staticmethod

covarSamp(x, y)

Returns the sample covariance between x and y. For n <= 1, nan is returned. Float64

covarSampMatrix(x1, x2=None) staticmethod

covarSampMatrix(x1[, x2, ...])

  • x1[, x2, ...] — One or more parameters over which to compute the sample covariance matrix. (U)Int* or Float* or Decimal

Returns the sample covariance matrix. Array(Array(Float64))

covarSampStable(x, y) staticmethod

covarSampStable(x, y)

Returns the sample covariance between x and y. For n <= 1, inf is returned. Float64

cramersV(column1, column2) staticmethod

cramersV(column1, column2)

Returns a value between 0 (corresponding to no association between the columns' values) to 1 (complete association). Float64

cramersVBiasCorrected(column1, column2) staticmethod

cramersVBiasCorrected(column1, column2)

  • column1 — First column to be compared. Any
  • column2 — Second column to be compared. Any

Returns a value between 0 (corresponding to no association between the columns' values) to 1 (complete association). Float64

cume_dist(*args) staticmethod

currentDatabase() staticmethod

currentDatabase()

Returns the current database name. String

currentProfiles() staticmethod

currentProfiles()

Returns an array of setting profiles for the current user. Array(String)

currentQueryID() staticmethod

currentQueryID()

currentRoles() staticmethod

currentRoles()

Returns an array of the roles which are assigned to the current user. Array(String)

currentSchemas(bool) staticmethod

currentSchemas(bool)

  • bool — A boolean value, which is ignored. Bool

Returns a single-element array with the name of the current database. Array(String)

currentUser() staticmethod

currentUser()

Returns the name of the current user, otherwise the login of the user who initiated the query. String

cutFragment(url) staticmethod

cutFragment(url)

Returns the URL with fragment identifier removed. String

cutIPv6(x, bytesToCutForIPv6, bytesToCutForIPv4) staticmethod

cutIPv6(x, bytesToCutForIPv6, bytesToCutForIPv4)

  • x — IPv6 address in binary format. FixedString(16) or IPv6
  • bytesToCutForIPv6 — Number of bytes to cut for IPv6. UInt8
  • bytesToCutForIPv4 — Number of bytes to cut for IPv4. UInt8

Returns a string containing the IPv6 address in text format with specified bytes removed. String

cutQueryString(url) staticmethod

cutQueryString(url)

Returns the URL with query string removed. String

cutQueryStringAndFragment(url) staticmethod

cutQueryStringAndFragment(url)

Returns the URL with query string and fragment identifier removed. String

cutToFirstSignificantSubdomain(url) staticmethod

cutToFirstSignificantSubdomain(url)

  • url — URL or domain string to process. String

Returns the part of the domain that includes top-level subdomains up to the first significant subdomain if possible, otherwise returns an empty string. String

cutToFirstSignificantSubdomainCustom(url, tld_list_name) staticmethod

cutToFirstSignificantSubdomainCustom(url, tld_list_name)

  • url — URL or domain string to process. String
  • tld_list_name — Name of the custom TLD list configured in ClickHouse. const String

Returns the part of the domain that includes top-level subdomains up to the first significant subdomain. String

cutToFirstSignificantSubdomainCustomRFC(url, tld_list_name) staticmethod

cutToFirstSignificantSubdomainCustomRFC(url, tld_list_name)

  • url — URL or domain string to process according to RFC 3986. - tld_list_name — Name of the custom TLD list configured in ClickHouse. Returns the part of the domain that includes top-level subdomains up to the first significant subdomain. String

cutToFirstSignificantSubdomainCustomWithWWW(url, tld_list_name) staticmethod

cutToFirstSignificantSubdomainCustomWithWWW(url, tld_list_name)

  • url — URL or domain string to process. - tld_list_name — Name of the custom TLD list configured in ClickHouse. Part of the domain that includes top-level subdomains up to the first significant subdomain without stripping 'www'. String

cutToFirstSignificantSubdomainCustomWithWWWRFC(url, tld_list_name) staticmethod

cutToFirstSignificantSubdomainCustomWithWWWRFC(url, tld_list_name)

  • url — URL or domain string to process according to RFC 3986. - tld_list_name — Name of the custom TLD list configured in ClickHouse. Returns the part of the domain that includes top-level subdomains up to the first significant subdomain without stripping www. String

cutToFirstSignificantSubdomainRFC(url) staticmethod

cutToFirstSignificantSubdomainRFC(url)

  • url — URL or domain string to process according to RFC 3986. String

Returns the part of the domain that includes top-level subdomains up to the first significant subdomain if possible, otherwise returns an empty string. String

cutToFirstSignificantSubdomainWithWWW(url) staticmethod

cutToFirstSignificantSubdomainWithWWW(url)

  • url — URL or domain string to process. String

Returns the part of the domain that includes top-level subdomains up to the first significant subdomain (with www) if possible, otherwise returns an empty string. String

cutToFirstSignificantSubdomainWithWWWRFC(url) staticmethod

cutToFirstSignificantSubdomainWithWWWRFC(url)

  • url — URL or domain string to process according to RFC 3986. Returns the part of the domain that includes top-level subdomains up to the first significant subdomain (with 'www') if possible, otherwise returns an empty string String

cutURLParameter(url, name) staticmethod

cutURLParameter(url, name)

URL with name URL parameter removed. String

cutWWW(url) staticmethod

cutWWW(url)

Returns the URL with leading www. removed from the domain. String

damerauLevenshteinDistance(s1, s2) staticmethod

damerauLevenshteinDistance(s1, s2)

  • s1 — First input string. String
  • s2 — Second input string. String

Returns the Damerau-Levenshtein distance between the two strings. UInt64

dateDiff(unit, startdate, enddate, timezone=None) staticmethod

dateDiff(unit, startdate, enddate[, timezone])

  • unit — The type of interval for result.
Unit Possible values
nanosecond nanosecond, nanoseconds, ns
microsecond microsecond, microseconds, us, u
millisecond millisecond, milliseconds, ms
second second, seconds, ss, s
minute minute, minutes, mi, n
hour hour, hours, hh, h
day day, days, dd, d
week week, weeks, wk, ww
month month, months, mm, m
quarter quarter, quarters, qq, q
year year, years, yyyy, yy
- startdate — The first time value to subtract (the subtrahend). Date or Date32 or DateTime or DateTime64
- enddate — The second time value to subtract from (the minuend). Date or Date32 or DateTime or DateTime64
- timezone — Optional. Timezone name. If specified, it is applied to both startdate and enddate. If not specified, timezones of startdate and enddate are used. If they are not the same, the result is unspecified. String

Returns the difference between enddate and startdate expressed in unit. Int64

dateName(date_part, date, timezone=None) staticmethod

dateName(date_part, date[, timezone])

Returns the specified part of date. String

dateTime64ToSnowflake(value) staticmethod

dateTime64ToSnowflake(value)

Returns the input value converted as the first Snowflake ID at that time. Int64

dateTime64ToSnowflakeID(value, epoch=None) staticmethod

dateTime64ToSnowflakeID(value[, epoch])

  • value — Date with time. DateTime64
  • epoch — Epoch of the Snowflake ID in milliseconds since 1970-01-01. Defaults to 0 (1970-01-01). For the Twitter/X epoch (2015-01-01), provide 1288834974657. UInt*

Input value converted to UInt64

dateTimeToSnowflake(value) staticmethod

dateTimeToSnowflake(value)

Returns the input value as the first Snowflake ID at that time. Int64

dateTimeToSnowflakeID(value, epoch=None) staticmethod

dateTimeToSnowflakeID(value[, epoch])

  • value — Date with time. DateTime
  • epoch — Epoch of the Snowflake ID in milliseconds since 1970-01-01. Defaults to 0 (1970-01-01). For the Twitter/X epoch (2015-01-01), provide 1288834974657. UInt*

Input value converted to UInt64

dateTimeToUUIDv7(value) staticmethod

dateTimeToUUIDv7(value)

Returns a UUIDv7. UUID

dateTrunc(unit, datetime, timezone=None) staticmethod

dateTrunc(unit, datetime[, timezone])

  • unit — The type of interval to truncate the result. Possible values: nanosecond (only DateTime64), microsecond (only DateTime64), millisecond (only DateTime64), second, minute, hour, day, week, month, quarter, year. String
  • datetime — Date and time. Date or Date32 or DateTime or DateTime64
  • timezone — Optional. Timezone name for the returned datetime. If not specified, the function uses the timezone of the datetime parameter. String

Returns the truncated date and time value.

Unit Argument datetime Argument Return Type
Year, Quarter, Month, Week Date32 or DateTime64 or Date or DateTime Date32 or Date
Day, Hour, Minute, Second Date32, DateTime64, Date, or DateTime DateTime64 or DateTime
Millisecond, Microsecond, Any DateTime64
Nanosecond with scale 3, 6, or 9

decodeHTMLComponent(s) staticmethod

decodeHTMLComponent(s)

  • s — String containing HTML entities to decode. String

Returns the string with HTML entities decoded. String

decodeURLComponent(url) staticmethod

decodeURLComponent(url)

Returns the decoded URL. String

decodeURLFormComponent(url) staticmethod

decodeURLFormComponent(url)

Returns the decoded URL. String

decodeXMLComponent(s) staticmethod

decodeXMLComponent(s)

  • s — String containing XML entities to decode. String

Returns the provided string with XML entities decoded. String

decrypt(mode, ciphertext, key, iv=None, aad=None) staticmethod

decrypt(mode, ciphertext, key[, iv, aad])

  • mode — Decryption mode. String
  • ciphertext — Encrypted text that should be decrypted. String
  • key — Decryption key. String
  • iv — Initialization vector. Required for -gcm modes, optional for others. String
  • aad — Additional authenticated data. Won't decrypt if this value is incorrect. Works only in -gcm modes, for others throws an exception. String

Returns decrypted plaintext. String

defaultProfiles() staticmethod

defaultProfiles()

Returns an array of default setting profile names for the current user. Array(String)

defaultRoles() staticmethod

defaultRoles()

Returns an array of default roles for the current user. Array(String)

defaultValueOfArgumentType(expression) staticmethod

defaultValueOfArgumentType(expression)

  • expression — Arbitrary type of value or an expression that results in a value of an arbitrary type. Any

Returns 0 for numbers, an empty string for strings or NULL for Nullable types. UInt8 or String or NULL

defaultValueOfTypeName(type) staticmethod

defaultValueOfTypeName(type)

  • type — A string representing a type name. String

Returns the default value for the given type name: 0 for numbers, an empty string for strings, or NULL for Nullable UInt8 or String or NULL

degrees(x) staticmethod

degrees(x)

Returns the value of x in degrees. Float64

deltaSum(x1, x2=None) staticmethod

deltaSum(x1[, x2, ...])

  • x1[, x2, ...] — One or more input values. Integer or Float

Returns a gained arithmetic difference of the input values. (U)Int* or Float*

deltaSumTimestamp(value, timestamp) staticmethod

deltaSumTimestamp(value, timestamp)

Returns accumulated differences between consecutive values, ordered by the timestamp parameter. (U)Int* or Float* or Date or DateTime

demangle(symbol) staticmethod

demangle(symbol)

  • symbol — Symbol from an object file. String

Returns the name of the C++ function, or an empty string if the symbol is not valid. String

denseRank(*args) staticmethod

detectCharset(s) staticmethod

detectCharset(s)

  • s — The text to analyze. String

Returns a string containing the code of the detected character set String

detectLanguage(s) staticmethod

detectLanguage(s)

  • text_to_be_analyzed — The text to analyze. String

Returns the 2-letter ISO code of the detected language. Other possible results: un = unknown, can not detect any language, other = the detected language does not have 2 letter code. String

detectLanguageMixed(s) staticmethod

detectLanguageMixed(s)

  • s — The text to analyze String

Returns a map with keys which are 2-letter ISO codes and corresponding values which are a percentage of the text found for that language Map(String, Float32)

detectLanguageUnknown(s) staticmethod

detectLanguageUnknown('s')

  • s — The text to analyze. String

Returns the 2-letter ISO code of the detected language. Other possible results: un = unknown, can not detect any language, other = the detected language does not have 2 letter code. String

detectTonality(s) staticmethod

detectTonality(s)

  • s — The text to be analyzed. String

Returns the average sentiment value of the words in text Float32

dictGet(dict_name, attr_names, id_expr) staticmethod

dictGet('dict_name', attr_names, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_names — Name of the column of the dictionary, or tuple of column names. String or Tuple(String)
  • id_expr — Key value. An expression returning UInt64/Tuple(T). UInt64 or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr if the key is found. If the key is not found, returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

dictGetAll(dict_name, attr_name, id_expr) staticmethod

dictGetAll(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetChildren(dict_name, key) staticmethod

dictGetChildren(dict_name, key)

Returns the first-level descendants for the key. Array(UInt64)

dictGetDate(dict_name, attr_name, id_expr) staticmethod

dictGetDate(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetDateOrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetDateOrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetDateTime(dict_name, attr_name, id_expr) staticmethod

dictGetDateTime(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetDateTimeOrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetDateTimeOrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetDescendants(dict_name, key, level) staticmethod

dictGetDescendants(dict_name, key, level)

  • dict_name — Name of the dictionary. String
  • key — Key to be checked. const String
  • level — Key to be checked. Hierarchy level. If level = 0 returns all descendants to the end. UInt8

Returns the descendants for the key. Array(UInt64)

dictGetFloat32(dict_name, attr_name, id_expr) staticmethod

dictGetFloat32(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetFloat32OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetFloat32OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetFloat64(dict_name, attr_name, id_expr) staticmethod

dictGetFloat64(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetFloat64OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetFloat64OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetHierarchy(dict_name, key) staticmethod

dictGetHierarchy(dict_name, key)

Returns parents for the key. Array(UInt64)

dictGetIPv4(dict_name, attr_name, id_expr) staticmethod

dictGetIPv4(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetIPv4OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetIPv4OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetIPv6(dict_name, attr_name, id_expr) staticmethod

dictGetIPv6(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetIPv6OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetIPv6OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetInt16(dict_name, attr_name, id_expr) staticmethod

dictGetInt16(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetInt16OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetInt16OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetInt32(dict_name, attr_name, id_expr) staticmethod

dictGetInt32(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetInt32OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetInt32OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetInt64(dict_name, attr_name, id_expr) staticmethod

dictGetInt64(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetInt64OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetInt64OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetInt8(dict_name, attr_name, id_expr) staticmethod

dictGetInt8(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetInt8OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetInt8OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetKeys(dict_name, attr_name, value_expr) staticmethod

dictGetKeys('dict_name', 'attr_name', value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Attribute to match. String
  • value_expr — Value to match against the attribute. Expression

For single key dictionaries: an array of keys whose attribute equals value_expr. For multi key dictionaries: an array of tuples of keys whose attribute equals value_expr. If there is no attribute corresponding to value_expr in the dictionary, then an empty array is returned. ClickHouse throws an exception if it cannot parse the value of the attribute or the value cannot be converted to the attribute data type.

dictGetOrDefault(dict_name, attr_names, id_expr, default_value) staticmethod

dictGetOrDefault('dict_name', attr_names, id_expr, default_value)

  • dict_name — Name of the dictionary. String
  • attr_names — Name of the column of the dictionary, or tuple of column names. String or Tuple(String)
  • id_expr — Key value. An expression returning UInt64/Tuple(T). UInt64 or Tuple(T)
  • default_value — Default value to return if the key is not found. Type must match the attribute's data type. Returns the value of the dictionary attribute that corresponds to id_expr if the key is found. If the key is not found, returns the default_value provided.

dictGetOrNull(dict_name, attr_name, id_expr) staticmethod

dictGetOrNull('dict_name', 'attr_name', id_expr)

  • dict_name — Name of the dictionary. String literal. - attr_name — Name of the column to retrieve. String literal. - id_expr — Key value. Expression returning dictionary key-type value. Returns the value of the dictionary attribute that corresponds to id_expr if the key is found. If the key is not found, returns NULL.

dictGetString(dict_name, attr_name, id_expr) staticmethod

dictGetString(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetStringOrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetStringOrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUInt16(dict_name, attr_name, id_expr) staticmethod

dictGetUInt16(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUInt16OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetUInt16OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUInt32(dict_name, attr_name, id_expr) staticmethod

dictGetUInt32(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUInt32OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetUInt32OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUInt64(dict_name, attr_name, id_expr) staticmethod

dictGetUInt64(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUInt64OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetUInt64OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUInt8(dict_name, attr_name, id_expr) staticmethod

dictGetUInt8(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUInt8OrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetUInt8OrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUUID(dict_name, attr_name, id_expr) staticmethod

dictGetUUID(dict_name, attr_name, id_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. An expression returning a dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the content of the <null_value> element specified for the attribute in the dictionary configuration.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictGetUUIDOrDefault(dict_name, attr_name, id_expr, default_value_expr) staticmethod

dictGetUUIDOrDefault(dict_name, attr_name, id_expr, default_value_expr)

  • dict_name — Name of the dictionary. String
  • attr_name — Name of the column of the dictionary. String or Tuple(String)
  • id_expr — Key value. Expression returning dictionary key-type value or tuple value (dictionary configuration dependent). Expression or Tuple(T)
  • default_value_expr — Value(s) returned if the dictionary does not contain a row with the id_expr key. Expression or Tuple(T)

Returns the value of the dictionary attribute that corresponds to id_expr, otherwise returns the value passed as the default_value_expr parameter.

note ClickHouse throws an exception if it cannot parse the value of the attribute or the value does not match the attribute data type.

dictHas(dict_name, id_expr) staticmethod

dictHas('dict_name', id_expr)

Returns 1 if the key exists, otherwise 0. UInt8

dictIsIn(dict_name, child_id_expr, ancestor_id_expr) staticmethod

dictIsIn(dict_name, child_id_expr, ancestor_id_expr)

  • dict_name — Name of the dictionary. String
  • child_id_expr — Key to be checked. String
  • ancestor_id_expr — Alleged ancestor of the child_id_expr key. const String

Returns 0 if child_id_expr is not a child of ancestor_id_expr, 1 if child_id_expr is a child of ancestor_id_expr or if child_id_expr is an ancestor_id_expr. UInt8

displayName() staticmethod

displayName()

Returns the value of display_name from config or server FQDN if not set. String

distinctDynamicTypes(dynamic) staticmethod

distinctDynamicTypes(dynamic)

  • dynamic — Dynamic column. Dynamic

Returns the sorted list of data type names. Array(String)

distinctJSONPaths(json) staticmethod

distinctJSONPaths(json)

  • json — JSON column. JSON

Returns the sorted list of paths. Array(String)

distinctJSONPathsAndTypes(json) staticmethod

distinctJSONPathsAndTypes(json)

  • json — JSON column. JSON

Returns the sorted map of paths and types. Map(String, Array(String))

divide(x, y) staticmethod

divide(x, y)

  • x — Dividend - y — Divisor The quotient of x and y

divideDecimal(x, y, result_scale=None) staticmethod

divideDecimal(x, y[, result_scale])

  • x — First value: Decimal. - y — Second value: Decimal. - result_scale — Scale of result. Type Int/UInt. The result of division with given scale. Decimal256

divideOrNull(x, y) staticmethod

divideOrNull(x, y)

  • x — Dividend - y — Divisor The quotient of x and y, or NULL.

domain(url) staticmethod

domain(url)

Returns the host name if the input string can be parsed as a URL, otherwise an empty string. String

domainRFC(url) staticmethod

domainRFC(url)

Returns the host name if the input string can be parsed as a URL, otherwise an empty string. String

domainWithoutWWW(url) staticmethod

domainWithoutWWW(url)

Returns the domain name if the input string can be parsed as a URL (without leading www.), otherwise an empty string. String

domainWithoutWWWRFC(url) staticmethod

domainWithoutWWWRFC(url)

Returns the domain name if the input string can be parsed as a URL (without leading www.), otherwise an empty string. String

dotProduct(vector1, vector2) staticmethod

dotProduct(vector1, vector2)

Returns the dot product of the two vectors. (U)Int* or Float* or Decimal

dumpColumnStructure(x) staticmethod

dumpColumnStructure(x)

  • x — Value for which to get the description of. Any

Returns a description of the column structure used for representing the value. String

dynamicElement(dynamic, type_name) staticmethod

dynamicElement(dynamic, type_name)

  • dynamic — Dynamic column to extract from. Dynamic
  • type_name — The name of the variant type to extract (e.g., 'String', 'Int64', 'Array(Int64)'). Returns values of the specified type from the Dynamic column. Returns NULL for non-matching types (or empty array for array types). Any

dynamicType(dynamic) staticmethod

dynamicType(dynamic)

  • dynamic — Dynamic column to inspect. Dynamic

Returns the type name of the value stored in each row, or 'None' for NULL values. String

e() staticmethod

e()

Returns Euler's constant Float64

editDistance(s1, s2) staticmethod

editDistance(s1, s2)

  • s1 — First input string. String
  • s2 — Second input string. String

Returns the edit distance between the two strings. UInt64

editDistanceUTF8(s1, s2) staticmethod

editDistanceUTF8(s1, s2)

  • s1 — First input string. String
  • s2 — Second input string. String

Returns the edit distance between the two UTF8 strings. UInt64

empty(arr) staticmethod

empty(arr)

Returns 1 for an empty array or 0 for a non-empty array UInt8

emptyArrayDate() staticmethod

emptyArrayDate()

An empty Date array. Array(T)

emptyArrayDateTime() staticmethod

emptyArrayDateTime()

An empty DateTime array. Array(T)

emptyArrayFloat32() staticmethod

emptyArrayFloat32()

An empty Float32 array. Array(T)

emptyArrayFloat64() staticmethod

emptyArrayFloat64()

An empty Float64 array. Array(T)

emptyArrayInt16() staticmethod

emptyArrayInt16()

An empty Int16 array. Array(T)

emptyArrayInt32() staticmethod

emptyArrayInt32()

An empty Int32 array. Array(T)

emptyArrayInt64() staticmethod

emptyArrayInt64()

An empty Int64 array. Array(T)

emptyArrayInt8() staticmethod

emptyArrayInt8()

An empty Int8 array. Array(T)

emptyArrayString() staticmethod

emptyArrayString()

An empty String array. Array(T)

emptyArrayToSingle(arr) staticmethod

emptyArrayToSingle(arr)

An array with a single value of the Array's default type. Array(T)

emptyArrayUInt16() staticmethod

emptyArrayUInt16()

An empty UInt16 array. Array(T)

emptyArrayUInt32() staticmethod

emptyArrayUInt32()

An empty UInt32 array. Array(T)

emptyArrayUInt64() staticmethod

emptyArrayUInt64()

An empty UInt64 array. Array(T)

emptyArrayUInt8() staticmethod

emptyArrayUInt8()

An empty UInt8 array. Array(T)

enabledProfiles() staticmethod

enabledProfiles()

Returns an array of setting profile names which are enabled for the current user. Array(String)

enabledRoles() staticmethod

enabledRoles()

Returns an array of role names which are enabled for the current user. Array(String)

encodeURLComponent(url) staticmethod

encodeURLComponent(url)

Returns the encoded URL. String

encodeURLFormComponent(url) staticmethod

encodeURLFormComponent(url)

Returns the encoded URL. String

encodeXMLComponent(s) staticmethod

encodeXMLComponent(s)

  • s — String to escape. String

Returns the escaped string. String

encrypt(mode, plaintext, key, iv=None, aad=None) staticmethod

encrypt(mode, plaintext, key[, iv, aad])

  • mode — Encryption mode. String
  • plaintext — Text that should be encrypted. String
  • key — Encryption key. String
  • iv — Initialization vector. Required for -gcm modes, optional for others. String
  • aad — Additional authenticated data. It isn't encrypted, but it affects decryption. Works only in -gcm modes, for others it throws an exception. String

Returns binary string ciphertext. String

endsWith(s, suffix) staticmethod

endsWith(s, suffix)

  • s — String to check. String
  • suffix — Suffix to check for. String

Returns 1 if s ends with suffix, otherwise 0. UInt8

endsWithCaseInsensitive(s, suffix) staticmethod

endsWithCaseInsensitive(s, suffix)

  • s — String to check. String
  • suffix — Case-insensitive suffix to check for. String

Returns 1 if s ends with case-insensitive suffix, otherwise 0. UInt8

endsWithCaseInsensitiveUTF8(s, suffix) staticmethod

endsWithCaseInsensitiveUTF8(s, suffix)

  • s — String to check. String
  • suffix — Case-insensitive suffix to check for. String

Returns 1 if s ends with case-insensitive suffix, otherwise 0. UInt8

endsWithUTF8(s, suffix) staticmethod

endsWithUTF8(s, suffix)

  • s — String to check. String
  • suffix — Suffix to check for. String

Returns 1 if s ends with suffix, otherwise 0. UInt8

entropy(val) staticmethod

entropy(val)

  • val — Column of values of any type. Any

Returns Shannon entropy. Float64

equals(a, b) staticmethod

equals(a, b) -- a = b -- a == b

  • a — First value.* - b — Second value.* Returns 1 if a is equal to b, otherwise 0 UInt8

erf(x) staticmethod

erf(x)

Returns the error function value Float*

erfc(x) staticmethod

erfc(x)

Returns the complementary error function value Float*

errorCodeToName(error_code) staticmethod

errorCodeToName(error_code)

Returns the textual name of error_code. String

estimateCompressionRatio(codec=None, block_size_bytes=None) staticmethod

estimateCompressionRatio([codec, block_size_bytes])(column)

  • column — Column of any type. Any

Returns an estimate compression ratio for the given column. Float64

evalMLMethod(model, x1, x2=None) staticmethod

evalMLMethod(model, x1[, x2, ...])

Returns the predicted value based on the trained model. Float64

exp(x) staticmethod

exp(x)

Returns e^x Float*

exp10(x) staticmethod

exp10(x)

Returns 10^x Float*

exp2(x) staticmethod

exp2(x)

Returns 2^x Float*

exponentialMovingAverage(x) staticmethod

exponentialMovingAverage(x)(value, timeunit)

  • value — Value. (U)Int* or Float* or Decimal
  • timeunit — Timeunit. Timeunit is not timestamp (seconds), it's an index of the time interval. Can be calculated using intDiv. (U)Int* or Float* or Decimal

Returns an exponentially smoothed moving average of the values for the past x time at the latest point of time. Float64

exponentialTimeDecayedAvg(x) staticmethod

exponentialTimeDecayedAvg(x)(v, t)

Returns an exponentially smoothed weighted moving average at index t in time. Float64

exponentialTimeDecayedCount(x) staticmethod

exponentialTimeDecayedCount(x)(t)

Returns the cumulative exponential decay at the given point in time. Float64

exponentialTimeDecayedMax(x) staticmethod

exponentialTimeDecayedMax(x)(value, timeunit)

Returns the maximum of the exponentially smoothed weighted moving average at t and t-1. Float64

exponentialTimeDecayedSum(x) staticmethod

exponentialTimeDecayedSum(x)(v, t)

Returns the sum of exponentially smoothed moving average values at the given point in time. Float64

extract(haystack, pattern) staticmethod

extract(haystack, pattern)

  • haystack — String from which to extract. String
  • pattern — Regular expression, typically containing a capturing group. const String

Returns extracted fragment as a string. String

extractAll(haystack, pattern) staticmethod

extractAll(haystack, pattern)

  • haystack — String from which to extract fragments. String
  • pattern — Regular expression, optionally containing capturing groups. const String

Returns array of extracted fragments. Array(String)

extractAllGroupsHorizontal(s, regexp) staticmethod

extractAllGroupsHorizontal(s, regexp)

Returns an array of arrays, where each inner array contains all captures from one capturing group across all matches. The first inner array contains all captures from group 1, the second from group 2, etc. If no matches are found, returns an empty array. Array(Array(String))

extractAllGroupsVertical(s, regexp) staticmethod

extractAllGroupsVertical(s, regexp)

Returns an array of arrays, where each inner array contains the captured groups from one match. Each match produces an array with elements corresponding to the capturing groups in the regular expression (group 1, group 2, etc.). If no matches are found, returns an empty array. Array(Array(String))

extractGroups(s, regexp) staticmethod

extractGroups(s, regexp)

If the function finds at least one matching group, it returns Array(Array(String)) column, clustered by group_id (1 to N, where N is number of capturing groups in regexp). If there is no matching group, it returns an empty array. Array(Array(String))

extractKeyValuePairs(input) staticmethod

extractKeyValuePairs(input)

extractKeyValuePairsWithEscaping(input) staticmethod

extractKeyValuePairsWithEscaping(input)

extractTextFromHTML(html) staticmethod

extractTextFromHTML(html)

  • html — String containing HTML content to extract text from. String

Returns the extracted text content with normalized whitespace. String

extractURLParameter(url, name) staticmethod

extractURLParameter(url, name)

Returns the value of the URL parameter with the specified name. String

extractURLParameterNames(url) staticmethod

extractURLParameterNames(url)

Returns an array of name strings corresponding to the names of URL parameters. Array(String)

extractURLParameters(url) staticmethod

extractURLParameters(url)

Returns an array of name=value strings corresponding to the URL parameters. Array(String)

factorial(n) staticmethod

factorial(n)

  • n — Integer value for which to calculate the factorial. Maximum value is 20. (U)Int8/16/32/64

Returns the factorial of the input as UInt64. Returns 1 for input 0 or any negative value. UInt64

farmFingerprint64(arg1, arg2=None) staticmethod

farmFingerprint64(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed hash value of the input arguments. UInt64

farmHash64(arg1, arg2=None) staticmethod

farmHash64(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed hash value of the input arguments. UInt64

file(path, default=None) staticmethod

file(path[, default])

  • path — The path of the file relative to the user_files_path. Supports wildcards *, **, ?, {abc,def} and {N..M} where N, M are numbers and 'abc', 'def' are strings. String
  • default — The value returned if the file does not exist or cannot be accessed. String or NULL

Returns the file content as a string. String

filesystemAvailable(disk_name=None) staticmethod

filesystemAvailable([disk_name])

  • disk_name — Optional. The disk name to find the amount of free space for. If omitted, uses the default disk. String or FixedString

Returns the amount of remaining space available in bytes. UInt64

filesystemCapacity(disk_name=None) staticmethod

filesystemCapacity([disk_name])

  • disk_name — Optional. The disk name to get the capacity for. If omitted, uses the default disk. String or FixedString

Returns the capacity of the filesystem in bytes. UInt64

filesystemUnreserved(disk_name=None) staticmethod

filesystemUnreserved([disk_name])

  • disk_name — Optional. The disk name for which to find the total amount of free space. If omitted, uses the default disk. String or FixedString

Returns the amount of free space in bytes. UInt64

finalizeAggregation(state) staticmethod

finalizeAggregation(state)

Returns the finalized result of aggregation. Any

financialInternalRateOfReturn(cashflows, guess=None) staticmethod

financialInternalRateOfReturn(cashflows[, guess])

  • cashflows — Array of cash flows. Each value represents a payment (negative value) or income (positive value). Array(Int8/16/32/64) or Array(Float*)
  • [, guess] — Optional initial guess (constant value) for the internal rate of return (default 0.1). Float*

Returns the internal rate of return or NaN if the calculation cannot converge, input array is empty or has only one element, all cash flows are zero, or other calculation errors occur. Float64

financialInternalRateOfReturnExtended(cashflow, date, guess=None, daycount=None) staticmethod

financialInternalRateOfReturnExtended(cashflow, date [, guess, daycount])

  • cashflow — An array of cash flows corresponding to the dates in second param. Array(Int8/16/32/64) or Array(Float*)
  • date — A sorted array of unique dates corresponding to the cash flows. Array(Date) or Array(Date32)
  • [, guess] — Optional. Initial guess (constant value) for the XIRR calculation. Float*
  • [, daycount] — Optional day count convention (default 'ACT_365F'). Supported values:
  • 'ACT_365F' - Actual/365 Fixed: Uses actual number of days between dates divided by 365
  • 'ACT_365_25' - Actual/365.25: Uses actual number of days between dates divided by 365.25 String

Returns the XIRR value. If the calculation cannot be performed, it returns NaN. Float64

financialNetPresentValue(rate, cashflows, start_from_zero=None) staticmethod

financialNetPresentValue(rate, cashflows[, start_from_zero])

  • rate — The discount rate to apply. Float*
  • cashflows — Array of cash flows. Each value represents a payment (negative value) or income (positive value). Array(Int8/16/32/64) or Array(Float*)
  • [, start_from_zero] — Optional boolean parameter indicating whether to start the NPV calculation from period 0 (true) or period 1 (false, Excel-compatible). Default: true. Bool

Returns the net present value as a Float64 value. Float64

financialNetPresentValueExtended(rate, cashflows, dates, daycount=None) staticmethod

financialNetPresentValueExtended(rate, cashflows, dates[, daycount])

  • rate — The discount rate to apply. Float*
  • cashflows — Array of cash flows. Each value represents a payment (negative value) or income (positive value). Must contain at least one positive and one negative value. Array(Int8/16/32/64) or Array(Float*)
  • dates — Array of dates corresponding to each cash flow. Must have the same size as cashflows array. Array(Date) or Array(Date32)
  • [, daycount] — Optional day count convention. Supported values: 'ACT_365F' (default) — Actual/365 Fixed, 'ACT_365_25' — Actual/365.25. String

Returns the net present value as a Float64 value. Float64

firstLine(s) staticmethod

firstLine(s)

Returns the first line of the input string or the whole string if there are no line separators. String

firstNonDefault(arg1, arg2=None) staticmethod

firstNonDefault(arg1[, arg2[ ...]])

  • arg1 — The first argument to check - arg2 — The second argument to check - ... — Additional arguments to check Result type is the supertype of all arguments

firstSignificantSubdomain(url) staticmethod

firstSignificantSubdomain(url)

firstSignificantSubdomainCustom(url, tld_list_name) staticmethod

firstSignificantSubdomainCustom(url, tld_list_name)

  • url — The URL to extract the subdomain from. String
  • tld_list_name — Name of the custom TLD list from the configuration. String

Returns the first significant subdomain. String

firstSignificantSubdomainCustomRFC(url, tld_list_name) staticmethod

firstSignificantSubdomainCustomRFC(url, tld_list_name)

  • url — The URL to extract the subdomain from. String
  • tld_list_name — Name of the custom TLD list from the configuration. String

Returns the first significant subdomain. String

firstSignificantSubdomainRFC(url) staticmethod

firstSignificantSubdomainRFC(url)

flameGraph(traces, size=None, ptr=None) staticmethod

flameGraph(traces[, size[, ptr]])

  • traces — A stacktrace. Array(UInt64)
  • size — Optional. An allocation size for memory profiling (default 1). UInt64
  • ptr — Optional. An allocation address (default 0). UInt64

Returns an array of strings for use with flamegraph.pl utility. Array(String)

flattenTuple(input) staticmethod

flattenTuple(input)

Returns an output tuple whose elements are paths from the original input. Tuple(T)

flipCoordinates(geometry) staticmethod

flipCoordinates(geometry)

  • geometry — The geometry to transform. Supported types: Point (Tuple(Float64, Float64)), Ring (Array(Point)), Polygon (Array(Ring)), MultiPolygon (Array(Polygon)), LineString (Array(Point)), MultiLineString (Array(LineString)), or Geometry (a variant containing any of these types). The geometry with flipped coordinates. The return type matches the input type. Point or Ring or Polygon or MultiPolygon or LineString or MultiLineString or Geometry

floor(x, N=None) staticmethod

floor(x[, N])

  • x — The value to round. Float* or Decimal* or (U)Int*
  • N — Optional. The number of decimal places to round to. Defaults to zero, which means rounding to an integer. Can be negative. (U)Int*

Returns a rounded number of the same type as x. Float* or Decimal* or (U)Int*

format(pattern, s0, s1=None) staticmethod

format(pattern, s0[, s1, ...])

  • pattern — The format string containing placeholders. String
  • s0[, s1, ...] — One or more values to substitute into the pattern. Any

Returns a formatted string. String

formatDateTime(datetime, format, timezone=None) staticmethod

formatDateTime(datetime, format[, timezone])

  • datetime — A date or date time to format. Date or Date32 or DateTime or DateTime64
  • format — Format string with replacement fields. String
  • timezone — Optional. Timezone name for the formatted time. String

Returns time and date values according to the determined format. String

formatDateTimeInJodaSyntax(datetime, format, timezone=None) staticmethod

formatDateTimeInJodaSyntax(datetime, format[, timezone])

  • datetime — A date or date time to format. DateTime or Date or Date32 or DateTime64
  • format — Format string with Joda-style replacement fields. String
  • timezone — Optional. Timezone name for the formatted time. String

Returns time and date values according to the determined format. String

formatQuery(query) staticmethod

formatQuery(query)

  • query — The SQL query to be formatted. String The formatted query String

formatQueryOrNull(query) staticmethod

formatQueryOrNull(query)

  • query — The SQL query to be formatted. String The formatted query String

formatQuerySingleLine(query) staticmethod

formatQuerySingleLine(query)

  • query — The SQL query to be formatted. String The formatted query String

formatQuerySingleLineOrNull(query) staticmethod

formatQuerySingleLineOrNull(query)

  • query — The SQL query to be formatted. String

The formatted query String

formatReadableDecimalSize(x) staticmethod

formatReadableDecimalSize(x)

Returns a readable, rounded size with suffix as a string. String

formatReadableQuantity(x) staticmethod

formatReadableQuantity(x)

  • x — A number to format. UInt64

Returns a rounded number with suffix as a string. String

formatReadableSize(x) staticmethod

formatReadableSize(x)

Returns a readable, rounded size with suffix as a string. String

formatReadableTimeDelta(column, maximum_unit=None, minimum_unit=None) staticmethod

formatReadableTimeDelta(column[, maximum_unit, minimum_unit])

  • column — A column with a numeric time delta. Float64
  • maximum_unit — Optional. Maximum unit to show. Acceptable values: nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days, months, years. Default value: years. const String
  • minimum_unit — Optional. Minimum unit to show. All smaller units are truncated. Acceptable values: nanoseconds, microseconds, milliseconds, seconds, minutes, hours, days, months, years. If explicitly specified value is bigger than maximum_unit, an exception will be thrown. Default value: seconds if maximum_unit is seconds or bigger, nanoseconds otherwise. const String

Returns a time delta as a string. String

formatRow(format, x, y) staticmethod

formatRow(format, x, y, ...)

  • format — Text format. For example, CSV, TSV. String
  • x, y, ... — Expressions. Any

A formatted string. (for text formats it's usually terminated with the new line character). String

formatRowNoNewline(format, x, y) staticmethod

formatRowNoNewline(format, x, y, ...)

  • format — Text format. For example, CSV, TSV. String
  • x, y, ... — Expressions. Any

Returns a formatted string with newlines removed. String

fragment(url) staticmethod

fragment(url)

Returns the fragment identifier without the initial hash symbol. String

fromDaysSinceYearZero(days) staticmethod

fromDaysSinceYearZero(days)

  • days — The number of days passed since year zero. UInt32

Returns the date corresponding to the number of days passed since year zero. Date

fromDaysSinceYearZero32(days) staticmethod

fromDaysSinceYearZero32(days)

  • days — The number of days passed since year zero. UInt32

Returns the date corresponding to the number of days passed since year zero. Date32

fromModifiedJulianDay(day) staticmethod

fromModifiedJulianDay(day)

  • day — Modified Julian Day number. (U)Int*

Returns date in text form. String

fromModifiedJulianDayOrNull(day) staticmethod

fromModifiedJulianDayOrNull(day)

  • day — Modified Julian Day number. (U)Int*

Returns date in text form for valid day argument, otherwise null. Nullable(String)

fromUTCTimestamp(datetime, time_zone) staticmethod

fromUTCTimestamp(datetime, time_zone)

  • datetime — A date or date with time const value or an expression. DateTime or DateTime64
  • time_zone — A String type const value or an expression representing the time zone. String

Returns DateTime/DateTime64 in the specified timezone. DateTime or DateTime64

fromUnixTimestamp(timestamp) staticmethod

fromUnixTimestamp(timestamp) fromUnixTimestamp(timestamp[, format[, timezone]])

  • timestamp — Unix timestamp or date/date with time value. (U)Int* or Date or Date32 or DateTime or DateTime64
  • format — Optional. Constant format string for output formatting. String
  • timezone — Optional. Constant time zone string. String

Returns DateTime of the timestamp when called with one argument, or a String when called with two or three arguments. DateTime or String

fromUnixTimestamp64Micro(value, timezone=None) staticmethod

fromUnixTimestamp64Micro(value[, timezone])

  • value — Unix timestamp in microseconds. Int64
  • timezone — Optional. Timezone for the returned value. String

Returns a DateTime64 value with microsecond precision. DateTime64(6)

fromUnixTimestamp64Milli(value, timezone=None) staticmethod

fromUnixTimestamp64Milli(value[, timezone])

  • value — Unix timestamp in milliseconds. Int64
  • timezone — Optional. Timezone for the returned value. String

A DateTime64 value with millisecond precision. DateTime64(3)

fromUnixTimestamp64Nano(value, timezone=None) staticmethod

fromUnixTimestamp64Nano(value[, timezone])

  • value — Unix timestamp in nanoseconds. Int64
  • timezone — Optional. Timezone for the returned value. String

Returns a DateTime64 value with nanosecond precision. DateTime64(9)

fromUnixTimestamp64Second(value, timezone=None) staticmethod

fromUnixTimestamp64Second(value[, timezone])

  • value — Unix timestamp in seconds. Int64
  • timezone — Optional. Timezone for the returned value. String

Returns a DateTime64 value with second precision. DateTime64(0)

fromUnixTimestampInJodaSyntax(timestamp) staticmethod

fromUnixTimestampInJodaSyntax(timestamp) fromUnixTimestampInJodaSyntax(timestamp, format[, timezone])

  • timestamp — Unix timestamp or date/time value. (U)Int* or Date or Date32 or DateTime or DateTime64
  • format — Optional. Constant format string using Joda syntax for output formatting. String
  • timezone — Optional. Constant time zone string. String

Returns a date with time when called with one argument, or a String when called with two or three arguments.} DateTime or String

fuzzBits(s, p) staticmethod

fuzzBits(s, p)

  • s — String or FixedString to perform bit fuzzing on String or FixedString
  • p — Probability of flipping each bit as a number between 0.0 and 1.0 Float*

Returns a Fuzzed string with same type as s. String or FixedString

fuzzQuery(query) staticmethod

fuzzQuery(query)

  • query — The SQL query to be fuzzed. String The fuzzed query string String

gccMurmurHash(arg1, arg2=None) staticmethod

gccMurmurHash(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of arguments for which to compute the hash. Any

Returns the calculated hash value of the input arguments. UInt64

gcd(x, y) staticmethod

gcd(x, y)

  • x — First integer - y — Second integer The greatest common divisor of x and y.

generateRandomStructure(number_of_columns=None, seed=None) staticmethod

generateRandomStructure([number_of_columns, seed])

  • number_of_columns — The desired number of columns in the resultant table structure. If set to 0 or Null, the number of columns will be random from 1 to 128. Default value: Null. UInt64
  • seed — Random seed to produce stable results. If seed is not specified or set to Null, it is randomly generated. UInt64

Randomly generated table structure. String

generateSerialID(series_identifier, start_value=None) staticmethod

generateSerialID(series_identifier[, start_value])

  • series_identifier — Series identifier const String
  • start_value — Optional. Starting value for the counter. Defaults to 0. Note: this value is only used when creating a new series and is ignored if the series already exists UInt*

Returns sequential numbers starting from the previous counter value. UInt64

generateSnowflakeID(expr=None, machine_id=None) staticmethod

generateSnowflakeID([expr, [machine_id]])

  • expr — An arbitrary expression used to bypass common subexpression elimination if the function is called multiple times in a query. The value of the expression has no effect on the returned Snowflake ID. Optional. - machine_id — A machine ID, the lowest 10 bits are used. Int64. Optional. Returns the Snowflake ID. UInt64

generateULID(x=None) staticmethod

generateULID([x])

  • x — Optional. An expression resulting in any of the supported data types. The resulting value is discarded, but the expression itself if used for bypassing common subexpression elimination if the function is called multiple times in one query. Any

Returns a ULID. FixedString(26)

generateUUIDv4(expr=None) staticmethod

generateUUIDv4([expr])

  • expr — Optional. An arbitrary expression used to bypass common subexpression elimination if the function is called multiple times in a query. The value of the expression has no effect on the returned UUID. Returns a UUIDv4. UUID

generateUUIDv7(expr=None) staticmethod

generateUUIDv7([expr])

  • expr — Optional. An arbitrary expression used to bypass common subexpression elimination if the function is called multiple times in a query. The value of the expression has no effect on the returned UUID. Any

Returns a UUIDv7. UUID

geoDistance(lon1Deg, lat1Deg, lon2Deg, lat2Deg) staticmethod

geoDistance(lon1Deg, lat1Deg, lon2Deg, lat2Deg)

  • lon1Deg — Longitude of the first point in degrees. Range: [-180°, 180°]. (U)Int* or Float* or Decimal
  • lat1Deg — Latitude of the first point in degrees. Range: [-90°, 90°]. (U)Int* or Float* or Decimal
  • lon2Deg — Longitude of the second point in degrees. Range: [-180°, 180°]. (U)Int* or Float* or Decimal
  • lat2Deg — Latitude of the second point in degrees. Range: [-90°, 90°]. (U)Int* or Float* or Decimal

Returns the distance between two points on the Earth's surface, in meters Float64

geoToH3(lat, lon, resolution) staticmethod

geoToH3(lat, lon, resolution)

  • lat — Latitude in degrees. Float64
  • lon — Longitude in degrees. Float64
  • resolution — Index resolution with range [0, 15]. UInt8

Returns the H3 index number, or 0 in case of error. UInt64

geoToS2(lon, lat) staticmethod

geoToS2(lon, lat)

Returns the S2 cell identifier. UInt64

geohashDecode(hash_str) staticmethod

geohashDecode(hash_str)

Returns a tuple of (longitude, latitude) with Float64 precision. Tuple(Float64, Float64)

geohashEncode(longitude, latitude, precision=None) staticmethod

geohashEncode(longitude, latitude, [precision])

  • longitude — Longitude part of the coordinate to encode. Range: [-180°, 180°]. Float32 or Float64
  • latitude — Latitude part of the coordinate to encode. Range: [-90°, 90°]. Float32 or Float64
  • precision — Optional. Length of the resulting encoded string. Default: 12. Range: [1, 12]. (U)Int*

Returns an alphanumeric string of the encoded coordinate (modified version of the base32-encoding alphabet is used) String

geohashesInBox(longitude_min, latitude_min, longitude_max, latitude_max, precision) staticmethod

geohashesInBox(longitude_min, latitude_min, longitude_max, latitude_max, precision)

  • longitude_min — Minimum longitude. Range: [-180°, 180°]. Float32 or Float64
  • latitude_min — Minimum latitude. Range: [-90°, 90°]. Float32 or Float64
  • longitude_max — Maximum longitude. Range: [-180°, 180°]. Float32 or Float64
  • latitude_max — Maximum latitude. Range: [-90°, 90°]. Float32 or Float64
  • precision — Geohash precision. Range: [1, 12]. UInt8

Returns an array of precision-long strings of geohash-boxes covering the provided area, or an empty array if the minimum longitude and latitude values aren't less than the corresponding maximum values. Array(String)

getClientHTTPHeader(name) staticmethod

getClientHTTPHeader(name)

  • name — The HTTP header name. String

Returns the value of the header. String

getMacro(name) staticmethod

getMacro(name)

Returns the value of the specified macro. String

getMaxTableNameLengthForDatabase(database_name) staticmethod

getMaxTableNameLengthForDatabase(database_name)

  • database_name — The name of the specified database. String

Returns the length of the maximum table name, an Integer

getMergeTreeSetting(setting_name) staticmethod

getMergeTreeSetting(setting_name)

  • setting_name — The setting name. String

Returns the merge tree setting's current value.

getOSKernelVersion() staticmethod

getOSKernelVersion()

Returns the current OS kernel version. String

getServerPort(port_name) staticmethod

getServerPort(port_name)

  • port_name — The name of the port. String

Returns the server port number. UInt16

getServerSetting(setting_name) staticmethod

getServerSetting(setting_name')

  • setting_name — The server setting name. String

Returns the server setting's current value. Any

getSetting(setting_name) staticmethod

getSetting(setting_name)

Returns the setting's current value. Any

getSettingOrDefault(setting_name, default_value) staticmethod

getSettingOrDefault(setting_name, default_value)

  • setting_name — The setting name. String
  • default_value — Value to return if custom_setting is not set. Value may be of any data type or Null. Returns the current value of the specified setting or default_value if the setting is not set.

getSizeOfEnumType(x) staticmethod

getSizeOfEnumType(x)

  • x — Value of type Enum. Enum

Returns the number of fields with Enum input values. UInt8/16

getSubcolumn(nested_value, subcolumn_name) staticmethod

getSubcolumn(nested_value, subcolumn_name)

getTypeSerializationStreams(col) staticmethod

getTypeSerializationStreams(col)

  • col — Column or string representation of a data-type from which the data type will be detected. Any

Returns an array with all the serialization sub-stream paths. Array(String)

globalIn(x, set) staticmethod

globalIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is in the set, 0 otherwise. UInt8

globalInIgnoreSet(x, set) staticmethod

globalIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is in the set, 0 otherwise. UInt8

globalNotIn(x, set) staticmethod

globalNotIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is not in the set, 0 otherwise. UInt8

globalNotInIgnoreSet(x, set) staticmethod

globalNotIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is not in the set, 0 otherwise. UInt8

globalNotNullIn(x, set) staticmethod

globalNotNullIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is not in the set, 0 otherwise. UInt8

globalNotNullInIgnoreSet(x, set) staticmethod

globalNotNullIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is not in the set, 0 otherwise. UInt8

globalNullIn(x, set) staticmethod

globalNullIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is in the set, 0 otherwise. UInt8

globalNullInIgnoreSet(x, set) staticmethod

globalNullIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is in the set, 0 otherwise. UInt8

globalVariable(name) staticmethod

globalVariable(name)

  • name — Global variable name. String

Returns the value of variable name. Any

greatCircleAngle(lon1Deg, lat1Deg, lon2Deg, lat2Deg) staticmethod

greatCircleAngle(lon1Deg, lat1Deg, lon2Deg, lat2Deg)

  • lon1Deg — Longitude of the first point in degrees. Range: [-180°, 180°] (U)Int* or Float* or Decimal
  • lat1Deg — Latitude of the first point in degrees. Range: [-90°, 90°]. (U)Int* or Float* or Decimal
  • lon2Deg — Longitude of the second point in degrees. Range: [-180°, 180°]. (U)Int* or Float* or Decimal
  • lat2Deg — Latitude of the second point in degrees. Range: [-90°, 90°]. (U)Int* or Float* or Decimal

Returns the central angle between the two points in degrees Float64

greatCircleDistance(lon1Deg, lat1Deg, lon2Deg, lat2Deg) staticmethod

greatCircleDistance(lon1Deg, lat1Deg, lon2Deg, lat2Deg)

  • lon1Deg — Longitude of the first point in degrees. Range: [-180°, 180°]. (U)Int* or Float* or Decimal
  • lat1Deg — Latitude of the first point in degrees. Range: [-90°, 90°]. (U)Int* or Float* or Decimal
  • lon2Deg — Longitude of the second point in degrees. Range: [-180°, 180°]. (U)Int* or Float* or Decimal
  • lat2Deg — Latitude of the second point in degrees. Range: [-90°, 90°]. (U)Int* or Float* or Decimal

Returns the distance between two points on the Earth's surface, in meters Float64

greater(a, b) staticmethod

greater(a, b) -- a > b

  • a — First value.* - b — Second value.* Returns 1 if a is greater than b, otherwise 0 UInt8

greaterOrEquals(a, b) staticmethod

greaterOrEquals(a, b) -- a >= b

  • a — First value.* - b — Second value.* Returns 1 if a is greater than or equal to b, otherwise 0 UInt8

greatest(x1, x2=None) staticmethod

greatest(x1[, x2, ...])

  • x1[, x2, ...] — One or multiple values to compare. All arguments must be of comparable types. Any

Returns the greatest value among the arguments, promoted to the largest compatible type. Any

groupArray(x) staticmethod

groupArray(x) groupArray(max_size)(x)

  • x — Argument values to collect into an array. Any

Returns an array of argument values. Array

groupArrayInsertAt(default_x, size) staticmethod

groupArrayInsertAt(default_x, size)([x, pos])

  • x — Value to be inserted. Any
  • pos — Position at which the specified element x is to be inserted. Index numbering in the array starts from zero. UInt32

Returns an array with inserted values. Array

groupArrayIntersect(x) staticmethod

groupArrayIntersect(x)

  • x — Argument (column name or expression). Any

Returns an array that contains elements that are in all arrays. Array

groupArrayLast(max_size) staticmethod

groupArrayLast(max_size)(x)

  • max_size — Maximum size of the resulting array. UInt64
  • x — Argument (column name or expression). Any

Returns an array of the last argument values. Array(T)

groupArrayMovingAvg(numbers_for_summing) staticmethod

groupArrayMovingAvg(numbers_for_summing) groupArrayMovingAvg(window_size)(numbers_for_summing)

  • numbers_for_summing — Expression resulting in a numeric data type value. (U)Int* or Float* or Decimal

Returns an array of the same size and type as the input data. Array

groupArrayMovingSum(numbers_for_summing) staticmethod

groupArrayMovingSum(numbers_for_summing) groupArrayMovingSum(window_size)(numbers_for_summing)

  • numbers_for_summing — Expression resulting in a numeric data type value. (U)Int* or Float* or Decimal

Returns an array of the same size and type as the input data. Array

groupArraySample(max_size, seed=None) staticmethod

groupArraySample(max_size[, seed])(x)

  • array_column — Column containing arrays to be aggregated. Array

Array of randomly selected x arguments. Array(T)

groupArraySorted(N) staticmethod

groupArraySorted(N)(column)

  • column — Column for which to group into an array. Any

Returns an array with the first N items in ascending order. Array

groupBitAnd(expr) staticmethod

groupBitAnd(expr)

  • expr — Expression of (U)Int* type. (U)Int*

Returns a value of (U)Int* type. (U)Int*

groupBitOr(expr) staticmethod

groupBitOr(expr)

  • expr — Expression of (U)Int* type. (U)Int*

Returns a value of (U)Int* type. (U)Int*

groupBitXor(expr) staticmethod

groupBitXor(expr)

  • expr — Expression of (U)Int* type. (U)Int*

Returns a value of (U)Int* type. (U)Int*

groupBitmap(expr) staticmethod

groupBitmap(expr) groupBitmapState(expr)

  • expr — Expression that results in a UInt* type. UInt*

Returns the count of type UInt64 type, or a bitmap object when using -State. UInt64

groupBitmapAnd(expr) staticmethod

groupBitmapAnd(expr) groupBitmapAndState(expr)

Returns a count of type UInt64, or a bitmap object when using -State. UInt64

groupBitmapOr(expr) staticmethod

groupBitmapOr(expr) groupBitmapOrState(expr)

Returns a count of type UInt64, or a bitmap object when using -State. UInt64

groupBitmapXor(expr) staticmethod

groupBitmapXor(expr) groupBitmapXorState(expr)

Returns a count of type UInt64, or a bitmap object when using -State. UInt64

groupConcat(delimiter, limit=None) staticmethod

groupConcat(delimiter [, limit])

  • expression — The expression or column name that outputs strings to be concatenated. String
  • delimiter — A string that will be used to separate concatenated values. This parameter is optional and defaults to an empty string or delimiter from parameters if not specified. String

Returns a string consisting of the concatenated values of the column or expression. If the group has no elements or only null elements, and the function does not specify a handling for only null values, the result is a nullable string with a null value. String

groupNumericIndexedVector(*args) staticmethod

groupUniqArray(x) staticmethod

groupUniqArray(x) groupUniqArray(max_size)(x)

  • x — Expression. Any

Returns an array of unique values. Array

h3CellAreaM2(index) staticmethod

h3CellAreaM2(index)

  • index — Hexagon index number. UInt64

Returns the exact area of the H3 cell in square meters. Float64

h3CellAreaRads2(index) staticmethod

h3CellAreaRads2(index)

  • index — Hexagon index number. UInt64

Returns the exact area of the H3 cell in square radians. Float64

h3Distance(start, end) staticmethod

h3Distance(start, end)

  • start — Hexagon index number that represents the starting point. UInt64
  • end — Hexagon index number that represents the ending point. UInt64

Returns the number of grid cells between the start and end indices. Returns a negative number if the distance cannot be computed. Int64

h3EdgeAngle(resolution) staticmethod

h3EdgeAngle(resolution)

  • resolution — Index resolution. Range: [0, 15]. UInt8

Returns the average length of an H3 hexagon edge in grades. Float64

h3EdgeLengthKm(resolution) staticmethod

h3EdgeLengthKm(resolution)

  • resolution — Index resolution with range [0, 15]. UInt8

Returns the average length of an H3 hexagon edge in kilometers. Float64

h3EdgeLengthM(resolution) staticmethod

h3EdgeLengthM(resolution)

  • resolution — Index resolution. Range: [0, 15]. UInt8

Returns the average edge length of an H3 hexagon in meters. Float64

h3ExactEdgeLengthKm(index) staticmethod

h3ExactEdgeLengthKm(index)

  • index — Hexagon index number. UInt64

Returns the exact length of the H3 edge in kilometers. Float64

h3ExactEdgeLengthM(index) staticmethod

h3ExactEdgeLengthM(index)

  • index — Hexagon index number. UInt64

Returns the exact length of the H3 edge in meters. Float64

h3ExactEdgeLengthRads(index) staticmethod

h3ExactEdgeLengthRads(index)

  • index — Hexagon index number. UInt64

Returns the exact length of the H3 edge in radians. Float64

h3GetBaseCell(index) staticmethod

h3GetBaseCell(index)

  • index — Hexagon index number. UInt64

Returns the hexagon base cell number. UInt8

h3GetDestinationIndexFromUnidirectionalEdge(edge) staticmethod

h3GetDestinationIndexFromUnidirectionalEdge(edge)

  • edge — Hexagon index number that represents a unidirectional edge. UInt64

Returns the destination hexagon index from the unidirectional edge. UInt64

h3GetFaces(index) staticmethod

h3GetFaces(index)

  • index — Hexagon index number. UInt64

Returns an array containing the indices (0-19) of the icosahedron faces that the H3 index intersects with. Array(UInt8)

h3GetIndexesFromUnidirectionalEdge(edge) staticmethod

h3GetIndexesFromUnidirectionalEdge(edge)

  • edge — Hexagon index number that represents a unidirectional edge. UInt64

Returns a tuple containing the origin and destination hexagon indices from the unidirectional edge, or (0,0) if the input is not valid. Tuple(UInt64, UInt64)

h3GetOriginIndexFromUnidirectionalEdge(edge) staticmethod

h3GetOriginIndexFromUnidirectionalEdge(edge)

  • edge — Hexagon index number that represents a unidirectional edge. UInt64

Returns the origin hexagon index from the unidirectional edge. UInt64

h3GetPentagonIndexes(resolution) staticmethod

h3GetPentagonIndexes(resolution)

  • resolution — Index resolution with range [0, 15]. UInt8

Returns an array of all pentagon H3 indices at the specified resolution. Array(UInt64)

h3GetRes0Indexes() staticmethod

h3GetRes0Indexes()

Returns an array of all resolution 0 H3 indices. Array(UInt64)

h3GetResolution(index) staticmethod

h3GetResolution(index)

  • index — Hexagon index number. UInt64

Returns the resolution of the H3 index with range [0, 15]. UInt8

h3GetUnidirectionalEdge(origin, destination) staticmethod

h3GetUnidirectionalEdge(origin, destination)

  • origin — The origin H3 cell index. UInt64
  • destination — The destination H3 cell index. UInt64

Returns the H3 unidirectional edge index. UInt64

h3GetUnidirectionalEdgeBoundary(index) staticmethod

h3GetUnidirectionalEdgeBoundary(index)

  • index — Hexagon index number that represents a unidirectional edge. UInt64

Returns an array of (longitude, latitude) pairs defining a unidirectional edge. Array(Float64, Float64)

h3GetUnidirectionalEdgesFromHexagon(index) staticmethod

h3GetUnidirectionalEdgesFromHexagon(index)

  • index — Hexagon index number that represents a cell. UInt64

Returns an array of H3 indexes representing each unidirectional edge. Array(UInt64)

h3HexAreaKm2(resolution) staticmethod

h3HexAreaKm2(resolution)

  • resolution — Index resolution with range [0, 15]. UInt8

Returns the average area of an H3 hexagon in square kilometers for the given resolution. Float64

h3HexAreaM2(resolution) staticmethod

h3HexAreaM2(resolution)

  • resolution — Index resolution with range [0, 15]. UInt8

Returns the average area of an H3 hexagon in square meters for the given resolution. Float64

h3HexRing(index, k) staticmethod

h3HexRing(index, k)

  • index — Hexagon index number that represents the origin. UInt64
  • k — Distance from the origin (ring size). UInt16

Returns an array of H3 indices forming a hexagonal ring around the origin, or 0 if a pentagonal distortion is encountered. Array(UInt64)

h3IndexesAreNeighbors(index1, index2) staticmethod

h3IndexesAreNeighbors(index1, index2)

  • index1 — First H3 index. UInt64
  • index2 — Second H3 index. UInt64

Returns 1 if the indexes are neighbors (sharing an edge), 0 otherwise. UInt8

h3IsPentagon(index) staticmethod

h3IsPentagon(index)

  • index — Hexagon index number. UInt64

Returns 1 if the index represents a pentagonal cell, 0 otherwise. UInt8

h3IsResClassIII(index) staticmethod

h3IsResClassIII(index)

  • index — Hexagon index number. UInt64

Returns 1 if the index has a Class III resolution (odd-numbered), 0 otherwise. UInt8

h3IsValid(h3index) staticmethod

h3IsValid(h3index)

  • h3index — Hexagon index number. UInt64

Returns 1 if the number is a valid H3 index, 0 otherwise. UInt8

h3Line(start, end) staticmethod

h3Line(start, end)

  • start — Hexagon index number that represents the starting point. UInt64
  • end — Hexagon index number that represents the ending point. UInt64

Returns an array of H3 indices representing the line between the start and end indices. Array(UInt64)

h3NumHexagons(resolution) staticmethod

h3NumHexagons(resolution)

  • resolution — Index resolution with range [0, 15]. UInt8

Returns the number of unique H3 indices at the specified resolution. Int64

h3PointDistKm(lat1, lon1, lat2, lon2) staticmethod

h3PointDistKm(lat1, lon1, lat2, lon2)

  • lat1 — Latitude of point1 in degrees. Float64
  • lon1 — Longitude of point1 in degrees. Float64
  • lat2 — Latitude of point2 in degrees. Float64
  • lon2 — Longitude of point2 in degrees. Float64

Returns the haversine or great circle distance in kilometers. Float64

h3PointDistM(lat1, lon1, lat2, lon2) staticmethod

h3PointDistM(lat1, lon1, lat2, lon2)

  • lat1 — Latitude of point1 in degrees. Float64
  • lon1 — Longitude of point1 in degrees. Float64
  • lat2 — Latitude of point2 in degrees. Float64
  • lon2 — Longitude of point2 in degrees. Float64

Returns the haversine or great circle distance in meters. Float64

h3PointDistRads(lat1, lon1, lat2, lon2) staticmethod

h3PointDistRads(lat1, lon1, lat2, lon2)

  • lat1 — Latitude of point1 in degrees. Float64
  • lon1 — Longitude of point1 in degrees. Float64
  • lat2 — Latitude of point2 in degrees. Float64
  • lon2 — Longitude of point2 in degrees. Float64

Returns the haversine or great circle distance in radians. Float64

h3PolygonToCells(geometry, resolution) staticmethod

h3PolygonToCells(geometry, resolution)

h3ToCenterChild(index, resolution) staticmethod

h3ToCenterChild(index, resolution)

  • index — Parent H3 index. UInt64
  • resolution — Resolution of the center child with range [0, 15]. UInt8

Returns the H3 index of the center child at the specified resolution. UInt64

h3ToChildren(index, resolution) staticmethod

h3ToChildren(index, resolution)

  • index — Parent H3 index. UInt64
  • resolution — Resolution of the child indexes with range [0, 15]. UInt8

Returns an array of child H3 indexes at the specified resolution. Array(UInt64)

h3ToGeo(h3Index) staticmethod

h3ToGeo(h3Index)

  • h3Index — H3 index. UInt64

Returns a tuple consisting of two values (lat, lon) where lat is latitude and lon is longitude. Tuple(Float64, Float64)

h3ToGeoBoundary(h3Index) staticmethod

h3ToGeoBoundary(h3Index)

  • h3Index — H3 index. UInt64

Returns an array of coordinate pairs (lat, lon) that define the boundary of the H3 hexagon. Array(Tuple(Float64, Float64))

h3ToParent(index, resolution) staticmethod

h3ToParent(index, resolution)

  • index — Child H3 index. UInt64
  • resolution — Resolution of the parent index with range [0, 15]. UInt8

Returns the parent H3 index at the specified resolution. UInt64

h3ToString(index) staticmethod

h3ToString(index)

  • index — H3 index number. UInt64

Returns the string representation of the H3 index. String

h3UnidirectionalEdgeIsValid(index) staticmethod

h3UnidirectionalEdgeIsValid(index)

  • index — Hexagon index number. UInt64

Returns 1 if the H3 index is a valid unidirectional edge, 0 otherwise. UInt8

h3kRing(h3index, k) staticmethod

h3kRing(h3index, k)

  • h3index — H3 index of the origin hexagon. UInt64
  • k — Radius UInt*

Returns an array of H3 indexes that are within k rings of the origin hexagon. Array(UInt64)

halfMD5(arg1, arg2=None, argN=None) staticmethod

halfMD5(arg1[, arg2, ..., argN])

  • arg1[, arg2, ..., argN] — Variable number of arguments for which to compute the hash. Any

Returns the computed half MD5 hash of the given input params returned as a UInt64 in big-endian byte order. UInt64

has(haystack, needle) staticmethod

has(haystack, needle)

  • haystack — The source array, map, or JSON. Array or Map or JSON
  • needle — The value to search for (element in array, key in map, or path string in JSON). Returns 1 if the haystack contains the specified needle, otherwise 0. UInt8

hasAll(set, subset) staticmethod

hasAll(set, subset)

  • set — Array of any type with a set of elements. Array(T)
  • subset — Array of any type that shares a common supertype with set containing elements that should be tested to be a subset of set. Array(T)

  • 1, if set contains all of the elements from subset.

  • 0, otherwise.

Raises a NO_COMMON_TYPE exception if the set and subset elements do not share a common supertype.

hasAllTokens(input, needles) staticmethod

hasAllTokens(input, needles)

Returns 1, if all needles match. 0, otherwise. UInt8

hasAny(arr_x, arr_y) staticmethod

hasAny(arr_x, arr_y)

  • arr_x — Array of any type with a set of elements. Array(T)
  • arr_y — Array of any type that shares a common supertype with array arr_x. Array(T)

  • 1, if arr_x and arr_y have one similar element at least.

  • 0, otherwise.

Raises a NO_COMMON_TYPE exception if any of the elements of the two arrays do not share a common supertype.

hasAnyTokens(input, needles) staticmethod

hasAnyTokens(input, needles)

Returns 1, if there was at least one match. 0, otherwise. UInt8

hasColumnInTable(hostname=None, username=None, password=None, database=None, table=None, column=None) staticmethod

hasColumnInTable([hostname[, username[, password]],]database, table, column)

Returns 1 if the given column exists, 0 otherwise. UInt8

hasSubsequence(haystack, needle) staticmethod

hasSubsequence(haystack, needle)

  • haystack — String in which to search for the subsequence. String
  • needle — Subsequence to be searched. String

Returns 1 if needle is a subsequence of haystack, 0 otherwise. UInt8

hasSubsequenceCaseInsensitive(haystack, needle) staticmethod

hasSubsequenceCaseInsensitive(haystack, needle)

  • haystack — String in which the search is performed. String
  • needle — Subsequence to be searched. String

Returns 1, if needle is a subsequence of haystack, 0 otherwise. UInt8

hasSubsequenceCaseInsensitiveUTF8(haystack, needle) staticmethod

hasSubsequenceCaseInsensitiveUTF8(haystack, needle)

  • haystack — UTF8-encoded string in which the search is performed. String
  • needle — UTF8-encoded subsequence string to be searched. String

Returns 1, if needle is a subsequence of haystack, 0 otherwise. UInt8

hasSubsequenceUTF8(haystack, needle) staticmethod

hasSubsequenceUTF8(haystack, needle)

  • haystack — The string in which to search. String
  • needle — The subsequence to search for. String

Returns 1 if needle is a subsequence of haystack, otherwise 0. UInt8

hasSubstr(arr1, arr2) staticmethod

hasSubstr(arr1, arr2)

  • arr1 — Array of any type with a set of elements. Array(T)
  • arr2 — Array of any type with a set of elements. Array(T)

Returns 1 if array arr1 contains array arr2. Otherwise, returns 0. UInt8

hasThreadFuzzer() staticmethod

hasThreadFuzzer()

Returns whether Thread Fuzzer is effective. UInt8

hasToken(haystack, token) staticmethod

hasToken(haystack, token)

Returns 1 if the token is found, 0 otherwise. UInt8

hasTokenCaseInsensitive(haystack, needle) staticmethod

hasTokenCaseInsensitive(haystack, needle)

hasTokenCaseInsensitiveOrNull(haystack, needle) staticmethod

hasTokenCaseInsensitiveOrNull(haystack, needle)

hasTokenOrNull(haystack, token) staticmethod

hasTokenOrNull(haystack, token)

  • haystack — String to be searched. Must be constant. String
  • token — Token to search for. const String

Returns 1 if the token is found, 0 otherwise, null if token is ill-formed. Nullable(UInt8)

hex(arg) staticmethod

hex(arg)

Returns a string with the hexadecimal representation of the argument. String

hilbertDecode(tuple_size, code) staticmethod

hilbertDecode(tuple_size, code)

Returns a tuple of the specified size. Tuple(UInt64)

hilbertEncode(args) staticmethod

-- Simplified mode hilbertEncode(args)

-- Expanded mode hilbertEncode(range_mask, args)

  • args — Up to two UInt values or columns of type UInt. UInt8/16/32/64
  • range_mask — For the expanded mode, up to two UInt values or columns of type UInt. UInt8/16/32/64

Returns a UInt64 code. UInt64

histogram(*args) staticmethod

hiveHash(arg) staticmethod

hiveHash(arg)

  • arg — Input string to hash. String

Returns the computed "hive hash" of the input string. Int32

hop(time_attr, hop_interval, window_interval, timezone=None) staticmethod

hop(time_attr, hop_interval, window_interval[, timezone])

  • time_attr — Date and time. DateTime
  • hop_interval — Positive Hop interval. Interval
  • window_interval — Positive Window interval. Interval
  • timezone — Optional. Timezone name. String

Returns the inclusive lower and exclusive upper bound of the corresponding hopping window. Tuple(DateTime, DateTime)

hopEnd(time_attr, hop_interval, window_interval, timezone=None) staticmethod

hopEnd(time_attr, hop_interval, window_interval[, timezone])

  • time_attr — Date and time. DateTime
  • hop_interval — Positive Hop interval. Interval
  • window_interval — Positive Window interval. Interval
  • timezone — Optional. Timezone name. String

Returns the exclusive upper bound of the corresponding hopping window. DateTime

hopStart(time_attr, hop_interval, window_interval, timezone=None) staticmethod

hopStart(time_attr, hop_interval, window_interval[, timezone])

  • time_attr — Date and time. DateTime
  • hop_interval — Positive Hop interval. Interval
  • window_interval — Positive Window interval. Interval
  • timezone — Optional. Timezone name. String

Returns the inclusive lower bound of the corresponding hopping window. DateTime

hostName() staticmethod

hostName()

Returns the host name. String

hypot(x, y) staticmethod

hypot(x, y)

Returns the length of the hypotenuse of a right-angle triangle. Float64

icebergBucket(N, value) staticmethod

icebergBucket(N, value)

Returns a 32-bit hash of the source value. Int32

icebergHash(value) staticmethod

icebergHash(value)

Returns a 32-bit Murmur3 hash, x86 variant, seeded with 0 Int32

icebergTruncate(N, value) staticmethod

icebergTruncate(N, value)

The same type as the argument

identity(x) staticmethod

identity(x)

  • x — Input value. Any

Returns the input value unchanged. Any

idnaDecode(s) staticmethod

idnaDecode(s)

Returns a Unicode (UTF-8) representation of the input string according to the IDNA mechanism of the input value. String

idnaEncode(s) staticmethod

idnaEncode(s)

Returns an ASCII representation of the input string according to the IDNA mechanism of the input value. String

ifNotFinite(x, y) staticmethod

ifNotFinite(x,y)

  • x — Value to check if infinite. Float*
  • y — Fallback value. Float*

  • x if x is finite.

  • y if x is not finite.

ifNull(x, alt) staticmethod

ifNull(x, alt)

  • x — The value to check for NULL. Any
  • alt — The value that the function returns if x is NULL. Any

Returns the value of x if it is not NULL, otherwise alt. Any

if_(cond, then, else_) staticmethod

if(cond, then, else)

  • cond — The evaluated condition. UInt8 or Nullable(UInt8) or NULL
  • then — The expression returned if cond is true. - else — The expression returned if cond is false or NULL. The result of either the then or else expressions, depending on condition cond.

ignore(x) staticmethod

ignore(x)

  • x — An input value which is unused and passed only so as to avoid a syntax error. Any

Always returns 0. UInt8

ilike(haystack, pattern) staticmethod

ilike(haystack, pattern) -- haystack ILIKE pattern

  • haystack — String in which the search is performed. String or FixedString
  • pattern — LIKE pattern to match against. String

Returns 1 if the string matches the LIKE pattern (case-insensitive), otherwise 0. UInt8

inIgnoreSet(x, set) staticmethod

in(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is in the set, 0 otherwise. UInt8

in_(x, set) staticmethod

in(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is in the set, 0 otherwise. UInt8

indexHint(expression) staticmethod

indexHint(expression)

  • expression — Any expression for index range selection. Expression

Returns 1 in all cases. UInt8

indexOf(arr, x) staticmethod

indexOf(arr, x)

  • arr — An array to search in for x. Array(T)
  • x — Value of the first matching element in arr for which to return an index. UInt64

Returns the index (numbered from one) of the first x in arr if it exists. Otherwise, returns 0. UInt64

indexOfAssumeSorted(arr, x) staticmethod

indexOfAssumeSorted(arr, x)

  • arr — A sorted array to search. Array(T)
  • x — Value of the first matching element in sorted arr for which to return an index. UInt64

Returns the index (numbered from one) of the first x in arr if it exists. Otherwise, returns 0. UInt64

initcap(s) staticmethod

initcap(s)

Returns s with the first letter of each word converted to upper case. String

initcapUTF8(s) staticmethod

initcapUTF8(s)

Returns s with the first letter of each word converted to upper case. String

initialQueryID() staticmethod

initialQueryID()

Returns the ID of the initial current query. String

initialQueryStartTime() staticmethod

initialQueryStartTime()

Returns the start time of the initial current query. DateTime

initializeAggregation(aggregate_function, arg1, arg2=None) staticmethod

initializeAggregation(aggregate_function, arg1[, arg2, ...])

  • aggregate_function — Name of the aggregation function to initialize. String
  • arg1[, arg2, ...] — Arguments of the aggregate function. Any

Returns the result of aggregation for every row passed to the function. The return type is the same as the return type of the function that initializeAggregation takes as a first argument. Any

intDiv(x, y) staticmethod

intDiv(x, y)

  • x — Left hand operand. - y — Right hand operand. Result of integer division of x and y

intDivOrNull(x, y) staticmethod

intDivOrNull(x, y)

Result of integer division of x and y, or NULL.

intDivOrZero(a, b) staticmethod

intDivOrZero(a, b)

Result of integer division of a and b, or zero.

intExp10(x) staticmethod

intExp10(x)

Returns 10^x. UInt64

intExp2(x) staticmethod

intExp2(x)

Returns 2^x. UInt64

intHash32(arg) staticmethod

intHash32(arg)

Returns the computed 32-bit hash code of the input integer UInt32

intHash64(int) staticmethod

intHash64(int)

64-bit hash code. UInt64

intervalLengthSum(start, end) staticmethod

intervalLengthSum(start, end)

Returns the total length of union of all ranges (segments on numeric axis). Depending on the type of the argument, the return value may be UInt64 or Float64 type. UInt64 or Float64

isConstant(x) staticmethod

isConstant(x)

  • x — An expression to check. Any

Returns 1 if x is constant, 0 if x is non-constant. UInt8

isDecimalOverflow(value, precision=None) staticmethod

isDecimalOverflow(value[, precision])

  • value — Decimal value to check. Decimal
  • precision — Optional. The precision of the Decimal type. If omitted, the initial precision of the first argument is used. UInt8

Returns 1 if the decimal value has more digits than allowed by its precision, 0 if the decimal value satisfies the specified precision. UInt8

isDistinctFrom(x, y) staticmethod

isDistinctFrom(x, y)

  • x — First value to compare. Can be any ClickHouse data type. Any
  • y — Second value to compare. Can be any ClickHouse data type. Any

Returns true if the two values are different, treating NULLs as comparable: - Returns true if x != y. - Returns true if exactly one of x or y is NULL. - Returns false if x = y, or both x and y are NULL. Bool

isDynamicElementInSharedData(dynamic) staticmethod

isDynamicElementInSharedData(dynamic)

  • dynamic — Dynamic column to inspect. Dynamic

Returns true if the value is stored in shared variant format, false if stored as a separate subcolumn or is NULL. Bool

isFinite(x) staticmethod

isFinite(x)

  • x — Number to check for finiteness. Float*

1 if x is not infinite and not NaN, otherwise 0.

isIPAddressInRange(address, prefix) staticmethod

isIPAddressInRange(address, prefix)

  • address — An IPv4 or IPv6 address. String
  • prefix — An IPv4 or IPv6 network prefix in CIDR. String

Returns 1 if the IP version of the address and the CIDR match, otherwise 0. UInt8

isIPv4String(string) staticmethod

isIPv4String(string)

  • string — IP address string to check. String

Returns 1 if string is IPv4 address, otherwise 0. UInt8

isIPv6String(string) staticmethod

isIPv6String(string)

  • string — IP address string to check. String

Returns 1 if string is IPv6 address, otherwise 0. UInt8

isInfinite(x) staticmethod

isInfinite(x)

  • x — Number to check for infiniteness. Float*

1 if x is infinite, otherwise 0 (including for NaN).

isMergeTreePartCoveredBy(nested_part, covering_part) staticmethod

isMergeTreePartCoveredBy(nested_part, covering_part)

  • nested_part — Name of expected nested part. String
  • covering_part — Name of expected covering part. String

Returns 1 if it covers, 0 otherwise. UInt8

isNaN(x) staticmethod

isNaN(x)

  • x — Argument to evaluate for if it is NaN. Float*

1 if NaN, otherwise 0

isNotDistinctFrom(x, y) staticmethod

isNotDistinctFrom(x, y)

  • x — First value to compare. Can be any ClickHouse data type. Any
  • y — Second value to compare. Can be any ClickHouse data type. Any

Returns true if the two values are equal, treating NULLs as comparable: - Returns true if x = y. - Returns true if both x and y are NULL. - Returns false if x != y, or exactly one of x or y is NULL. Bool

isNotNull(x) staticmethod

isNotNull(x)

  • x — A value of non-compound data type. Any

Returns 1 if x is not NULL, otherwise 0. UInt8

isNull(x) staticmethod

isNull(x)

  • x — A value of non-compound data type. Any

Returns 1 if x is NULL, otherwise 0. UInt8

isNullable(x) staticmethod

isNullable(x)

  • x — A value of any data type. Any

Returns 1 if x is of a Nullable data type, otherwise 0. UInt8

isValidASCII(str) staticmethod

isValidASCII(str)

isValidJSON(json) staticmethod

isValidJSON(json)

  • json — JSON string to validate String

Returns 1 if the string is valid JSON, otherwise 0. UInt8

isValidUTF8(s) staticmethod

isValidUTF8(s)

  • s — The string to check for UTF-8 encoded validity. String

Returns 1, if the set of bytes constitutes valid UTF-8-encoded text, otherwise 0. UInt8

isZeroOrNull(x) staticmethod

isZeroOrNull(x)

  • x — A numeric value. UInt

Returns 1 if x is NULL or equal to zero, otherwise 0. UInt8/16/32/64 or Float32/Float64

jaroSimilarity(s1, s2) staticmethod

jaroSimilarity(s1, s2)

  • s1 — First input string. String
  • s2 — Second input string. String

Returns the Jaro similarity between the two strings. Float64

jaroWinklerSimilarity(s1, s2) staticmethod

jaroWinklerSimilarity(s1, s2)

  • s1 — First input string. String
  • s2 — Second input string. String

Returns the Jaro-Winkler similarity between the two strings. Float64

javaHash(arg) staticmethod

javaHash(arg)

  • arg — Input value to hash. Any

Returns the computed hash of arg Int32

javaHashUTF16LE(arg) staticmethod

javaHashUTF16LE(arg)

  • arg — A string in UTF-16LE encoding. String

Returns the computed hash of the UTF-16LE encoded string. Int32

joinGet(join_storage_table_name, value_column, join_keys) staticmethod

joinGet(join_storage_table_name, value_column, join_keys)

  • join_storage_table_name — An identifier which indicates where to perform the search. The identifier is searched in the default database (see parameter default_database in the config file). To override the default database, use the USE database_name query or specify the database and the table through a dot, like database_name.table_name. String
  • value_column — The name of the column of the table that contains required data. const String
  • join_keys — A list of join keys. Any

Returns list of values corresponded to list of keys. Any

joinGetOrNull(join_storage_table_name, value_column, join_keys) staticmethod

joinGetOrNull(join_storage_table_name, value_column, join_keys)

  • join_storage_table_name — An identifier which indicates where to perform the search. The identifier is searched in the default database (see parameter default_database in the config file). To override the default database, use the USE database_name query or specify the database and the table through a dot, like database_name.table_name. String
  • value_column — The name of the column of the table that contains required data. const String
  • join_keys — A list of join keys. Any

Returns a list of values corresponding to the list of keys, or NULL if a key is not found. Any

jumpConsistentHash(key, buckets) staticmethod

jumpConsistentHash(key, buckets)

  • key — The input key. UInt64
  • buckets — The number of buckets. Int32

Returns the computed hash value. Int32

kafkaMurmurHash(arg1, arg2=None) staticmethod

kafkaMurmurHash(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of parameters for which to compute the hash. Any

Returns the calculated hash value of the input arguments. UInt32

keccak256(message) staticmethod

keccak256(message)

  • message — The input string to hash. String

Returns the 32-byte Keccak-256 hash of the input string as a fixed-length string. FixedString(32)

kolmogorovSmirnovTest(alternative=None, computation_method=None) staticmethod

kolmogorovSmirnovTest([alternative, computation_method])(sample_data, sample_index)

Returns a tuple with two elements: a calculated statistic and a calculated p-value. Tuple(Float64, Float64)

kostikConsistentHash(input, n) staticmethod

kostikConsistentHash(input, n)

  • input — An integer key. UInt64
  • n — The number of buckets. UInt16

Returns the computed hash value. UInt16

kql_array_sort_asc(array1, array2=None, nulls_last=None) staticmethod

kql_array_sort_asc(array1[, array2, ..., nulls_last])

  • array1 — The array to sort. Array(T)
  • array2 — Optional. Additional arrays to reorder according to array1's sort order. Array(T)
  • nulls_last — Optional. A boolean indicating whether nulls should appear last. Default is true. UInt8

Returns a tuple of arrays sorted in ascending order. Tuple(Array, ...)

kql_array_sort_desc(array1, array2=None, nulls_last=None) staticmethod

kql_array_sort_desc(array1[, array2, ..., nulls_last])

  • array1 — The array to sort. Array(T)
  • array2 — Optional additional arrays to reorder according to array1's sort order. Array(T)
  • nulls_last — Optional boolean indicating whether nulls should appear last. Default is true. UInt8

Returns a tuple of arrays sorted in descending order. Tuple(Array, ...)

kurtPop(expr) staticmethod

kurtPop(expr)

Returns the kurtosis of the given distribution. Float64

kurtSamp(expr) staticmethod

kurtSamp(expr)

Returns the kurtosis of the given distribution. If n <= 1 (n is a size of the sample), then the function returns nan. Float64

lag(*args) staticmethod

lagInFrame(*args) staticmethod

largestTriangleThreeBuckets(n) staticmethod

largestTriangleThreeBuckets(n)(x, y)

Returns an array of tuples with two elements.. Array(Tuple(Float64, Float64))

lcm(x, y) staticmethod

lcm(x, y)

Returns the least common multiple of x and y. (U)Int*

lead(*args) staticmethod

leadInFrame(*args) staticmethod

least(x1, x2=None) staticmethod

least(x1[, x2, ...])

  • x1[, x2, ...] — A single value or multiple values to compare. All arguments must be of comparable types. Any

Returns the least value among the arguments, promoted to the largest compatible type. Any

left(s, offset) staticmethod

left(s, offset)

  • s — The string to calculate a substring from. String or FixedString
  • offset — The number of bytes of the offset. (U)Int*

Returns: - For positive offset, a substring of s with offset many bytes, starting from the left of the string. - For negative offset, a substring of s with length(s) - |offset| bytes, starting from the left of the string. - An empty string if length is 0. String

leftPad(string, length, pad_string=None) staticmethod

leftPad(string, length[, pad_string])

  • string — Input string that should be padded. String
  • length — The length of the resulting string. If the value is smaller than the input string length, then the input string is shortened to length characters. (U)Int*
  • pad_string — Optional. The string to pad the input string with. If not specified, then the input string is padded with spaces. String

Returns a left-padded string of the given length. String

leftPadUTF8(string, length, pad_string=None) staticmethod

leftPadUTF8(string, length[, pad_string])

  • string — Input string that should be padded. String
  • length — The length of the resulting string. If the value is smaller than the input string length, then the input string is shortened to length characters. (U)Int*
  • pad_string — Optional. The string to pad the input string with. If not specified, then the input string is padded with spaces. String

Returns a left-padded string of the given length. String

leftUTF8(s, offset) staticmethod

    leftUTF8(s, offset)

    - `s` — The UTF-8 encoded string to calculate a substring from. [`String`](https://clickhouse.com/docs/sql-reference/data-types/string) or [`FixedString`](https://clickhouse.com/docs/sql-reference/data-types/fixedstring)
    - `offset` — The number of bytes of the offset. [`(U)Int*`](https://clickhouse.com/docs/sql-reference/data-types/int-uint)

    Returns:
    - For positive `offset`, a substring of `s` with `offset` many bytes, starting from the left of the string.

" - For negative offset, a substring of s with length(s) - |offset| bytes, starting from the left of the string. " - An empty string if length is 0. String

lemmatize(lang, word) staticmethod

lemmatize(lang, word)

  • lang — Language which rules will be applied. String
  • word — Lowercase word that needs to be lemmatized. String

Returns the lemmatized form of the word String

length(x) staticmethod

length(x)

  • x — Value for which to calculate the number of bytes (for String/FixedString) or elements (for Array). String or FixedString or Array(T)

Returns the number of number of bytes in the String/FixedString x / the number of elements in array x UInt64

lengthUTF8(s) staticmethod

lengthUTF8(s)

  • s — String containing valid UTF-8 encoded text. String

Length of the string s in Unicode code points. UInt64

less(a, b) staticmethod

less(a, b) -- a < b

  • a — First value.* - b — Second value.* Returns 1 if a is less than b, otherwise 0 UInt8

lessOrEquals(a, b) staticmethod

lessOrEquals(a, b) -- a <= b

  • a — First value.* - b — Second value.* Returns 1 if a is less than or equal to b, otherwise 0 UInt8

lgamma(x) staticmethod

lgamma(x)

  • x — The number for which to compute the logarithm of the gamma function. (U)Int* or Float* or Decimal*

Returns the logarithm of the gamma function of x. Float*

like(haystack, pattern) staticmethod

like(haystack, pattern) -- haystack LIKE pattern

  • haystack — String in which the search is performed. String or FixedString
  • patternLIKE pattern to match against. Can contain % (matches any number of characters), _ (matches single character), and \ for escaping. String

Returns 1 if the string matches the LIKE pattern, otherwise 0. UInt8

locate(needle, haystack, start_pos=None) staticmethod

locate(needle, haystack[, start_pos])

  • needle — Substring to be searched. String
  • haystack — String in which the search is performed. String or Enum
  • start_pos — Optional. Position (1-based) in haystack at which the search starts. UInt

Returns starting position in bytes and counting from 1, if the substring was found, 0, if the substring was not found. UInt64

log(x) staticmethod

log(x)

Returns the natural logarithm of x. Float*

log10(x) staticmethod

log10(x)

Returns the decimal logarithm of x. Float*

log1p(x) staticmethod

log1p(x)

Returns values from the interval: -∞ < log1p(x) < +∞ Float64

log2(x) staticmethod

log2(x)

Returns the binary logarithm of x. Float*

logTrace(message) staticmethod

logTrace(message)

  • message — Message that is emitted to the server log. const String

Returns 0 always. UInt8

lowCardinalityIndices(col) staticmethod

lowCardinalityIndices(col)

The position of the value in the dictionary of the current part. UInt64

lowCardinalityKeys(col) staticmethod

lowCardinalityKeys(col)

Returns the dictionary keys. UInt64

lower(s) staticmethod

lower(s)

  • s — A string to convert to lowercase. String

Returns a lowercase string from s. String

lowerUTF8(input) staticmethod

lowerUTF8(input)

  • input — Input string to convert to lowercase. String

Returns a lowercase string. String

makeDate(year, month, day) staticmethod

makeDate(year, month, day) makeDate(year, day_of_year)

Returns a Date value constructed from the provided arguments Date

makeDate32(year, month, day) staticmethod

makeDate32(year, month, day) makeDate32(year, day_of_year)

Returns a Date32 value constructed from the provided arguments Date32

makeDateTime(year, month, day, hour, minute, second, timezone=None) staticmethod

makeDateTime(year, month, day, hour, minute, second[, timezone])

Returns a DateTime value constructed from the provided arguments DateTime

makeDateTime64(year, month, day, hour, minute, second, fraction=None, precision=None, timezone=None) staticmethod

makeDateTime64(year, month, day, hour, minute, second[, fraction[, precision[, timezone]]])

Returns a DateTime64 value constructed from the provided arguments DateTime64

mannWhitneyUTest(alternative, continuity_correction=None) staticmethod

mannWhitneyUTest(alternative[, continuity_correction])

Returns a tuple with two elements: calculated U-statistic and calculated p-value. Tuple(Float64, Float64)

map(key1, value1, key2=None, value2=None) staticmethod

map(key1, value1[, key2, value2, ...])

  • key_n — The keys of the map entries. Any
  • value_n — The values of the map entries. Any

Returns a map containing key:value pairs. Map(Any, Any)

mapAdd(arg1, arg2=None) staticmethod

mapAdd(arg1[, arg2, ...])

  • arg1[, arg2, ...] — Maps or tuples of two arrays in which items in the first array represent keys, and the second array contains values for each key. Map(K, V) or Tuple(Array(T), Array(T))

Returns a map or returns a tuple, where the first array contains the sorted keys and the second array contains values. Map(K, V) or Tuple(Array(T), Array(T))

mapAll(func=None, map=None) staticmethod

mapAll([func,] map)

Returns 1 if all key-value pairs satisfy the condition, 0 otherwise. UInt8

mapApply(func, map) staticmethod

mapApply(func, map)

Returns a new map obtained from the original map by application of func for each element. Map(K, V)

mapConcat(maps) staticmethod

mapConcat(maps)

  • maps — Arbitrarily many maps. Map

Returns a map with concatenated maps passed as arguments. Map

mapContainsKey(map, key) staticmethod

mapContainsKey(map, key)

  • map — Map to search in. Map(K, V)
  • key — Key to search for. Type must match the key type of the map. Any

Returns 1 if map contains key, 0 if not. UInt8

mapContainsKeyLike(map, pattern) staticmethod

mapContainsKeyLike(map, pattern)

Returns 1 if map contains a key matching pattern, 0 otherwise. UInt8

mapContainsValue(map, value) staticmethod

mapContainsValue(map, value)

  • map — Map to search in. Map(K, V)
  • value — Value to search for. Type must match the value type of map. Any

Returns 1 if the map contains the value, 0 if not. UInt8

mapContainsValueLike(map, pattern) staticmethod

mapContainsValueLike(map, pattern)

Returns 1 if map contains a value matching pattern, 0 otherwise. UInt8

mapExists(func=None, map=None) staticmethod

mapExists([func,] map)

Returns 1 if at least one key-value pair satisfies the condition, 0 otherwise. UInt8

mapExtractKeyLike(map, pattern) staticmethod

mapExtractKeyLike(map, pattern)

Returns a map containing elements the key matching the specified pattern. If no elements match the pattern, an empty map is returned. Map(K, V)

mapExtractValueLike(map, pattern) staticmethod

mapExtractValueLike(map, pattern)

Returns a map containing elements the value matching the specified pattern. If no elements match the pattern, an empty map is returned. Map(K, V)

mapFilter(func, map) staticmethod

mapFilter(func, map)

Returns a map containing only the elements in the map for which func returns something other than 0. Map(K, V)

mapFromArrays(keys, values) staticmethod

mapFromArrays(keys, values)

  • keys — Array or map of keys to create the map from. Array or Map
  • values — Array or map of values to create the map from. Array or Map

Returns a map with keys and values constructed from the key array and value array/map. Map

mapKeys(map) staticmethod

mapKeys(map)

  • map — Map to extract keys from. Map(K, V)

Returns array containing all keys from the map. Array(T)

mapPartialReverseSort(func=None, limit=None, map=None) staticmethod

mapPartialReverseSort([func,] limit, map)

Returns a partially sorted map in descending order. Map(K, V)

mapPartialSort(func=None, limit=None, map=None) staticmethod

mapPartialSort([func,] limit, map)

Returns a partially sorted map. Map(K, V)

mapPopulateSeries(map, max=None) staticmethod

mapPopulateSeries(map[, max]) | mapPopulateSeries(keys, values[, max])

Returns a map or a tuple of two arrays where the first has keys in sorted order, and the second values for the corresponding keys. Map(K, V) or Tuple(Array(UInt*), Array(Any))

mapReverseSort(func=None, map=None) staticmethod

mapReverseSort([func,] map)

Returns a map sorted in descending order. Map(K, V)

mapSort(func=None, map=None) staticmethod

mapSort([func,] map)

Returns a map sorted in ascending order. Map(K, V)

mapSubtract(arg1, arg2=None) staticmethod

mapSubtract(arg1[, arg2, ...])

  • arg1[, arg2, ...] — Maps or tuples of two arrays in which items in the first array represent keys, and the second array contains values for each key. Map(K, V) or Tuple(Array(T), Array(T))

Returns one map or tuple, where the first array contains the sorted keys and the second array contains values. Map(K, V) or Tuple(Array(T), Array(T))

mapUpdate(map1, map2) staticmethod

mapUpdate(map1, map2)

Returns map1 with values updated from values for the corresponding keys in map2. Map(K, V)

mapValues(map) staticmethod

mapValues(map)

  • map — Map to extract values from. Map(K, V)

Returns an array containing all the values from the map. Array(T)

match(haystack, pattern) staticmethod

match(haystack, pattern)

  • haystack — String in which the pattern is searched. String
  • pattern — Regular expression pattern. const String

Returns 1 if the pattern matches, 0 otherwise. UInt8

materialize(x) staticmethod

materialize(x)

  • x — A constant. Any

Returns a full column containing the constant value. Any

max(column) staticmethod

max(column)

  • column — Column name or expression. Any

The maximum value across the group with type equal to that of the input. Any

max2(x, y) staticmethod

max2(x, y)

Returns the bigger value of x and y. Float64

maxIntersections(start_column, end_column) staticmethod

maxIntersections(start_column, end_column)

  • start_column — A numeric column that represents the start of each interval. If start_column is NULL or 0 then the interval will be skipped. (U)Int* or Float*
  • end_column — A numeric column that represents the end of each interval. If end_column is NULL or 0 then the interval will be skipped. (U)Int* or Float*

Returns the maximum number of intersected intervals. UInt64

maxIntersectionsPosition(start_column, end_column) staticmethod

maxIntersectionsPosition(start_column, end_column)

  • start_column — A numeric column that represents the start of each interval. If start_column is NULL or 0 then the interval will be skipped. (U)Int* or Float*
  • end_column — A numeric column that represents the end of each interval. If end_column is NULL or 0 then the interval will be skipped. (U)Int* or Float*

Returns the start positions of the maximum number of intersected intervals. Any

maxMappedArrays(key, value) staticmethod

maxMappedArrays(key, value) maxMappedArrays(Tuple(key, value))

Returns a tuple of two arrays: keys in sorted order, and values calculated for the corresponding keys. Tuple(Array(T), Array(T))

meanZTest(population_variance_x, population_variance_y, confidence_level) staticmethod

meanZTest(population_variance_x, population_variance_y, confidence_level)(sample_data, sample_index)

Returns a tuple with four elements: calculated z-statistic, calculated p-value, calculated confidence-interval-low, calculated confidence-interval-high. Tuple(Float64, Float64, Float64, Float64)

mergeTreePartInfo(part_name) staticmethod

mergeTreePartInfo(part_name)

  • part_name — Name of part to unpack. String

Returns a Tuple with subcolumns: partition_id, min_block, max_block, level, mutation. Tuple

metroHash64(arg1, arg2=None) staticmethod

metroHash64(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed hash of the input arguments. UInt64

midpoint(x1, x2=None) staticmethod

midpoint(x1[, x2, ...])

  • x1[, x2, ...] — Accepts a single value or multiple values for averaging. Returns the average value of the provided arguments, promoted to the largest compatible type.

min(column) staticmethod

min(column)

  • column — Column name or expression. Any

Returns the minimum value across the group with type equal to that of the input. Any

min2(x, y) staticmethod

min2(x, y)

Returns the smaller value of x and y. Float64

minMappedArrays(key, value) staticmethod

minMappedArrays(key, value) minMappedArrays(Tuple(key, value))

Returns a tuple of two arrays: keys in sorted order, and values calculated for the corresponding keys. Tuple(Array(T), Array(T))

minSampleSizeContinuous(baseline, sigma, mde, power, alpha) staticmethod

minSampleSizeContinuous(baseline, sigma, mde, power, alpha)

  • baseline — Baseline value of a metric. (U)Int* or Float*
  • sigma — Baseline standard deviation of a metric. (U)Int* or Float*
  • mde — Minimum detectable effect (MDE) as percentage of the baseline value (e.g. for a baseline value 112.25 the MDE 0.03 means an expected change to 112.25 ± 112.25*0.03). (U)Int* or Float*
  • power — Required statistical power of a test (1 - probability of Type II error). (U)Int* or Float*
  • alpha — Required significance level of a test (probability of Type I error). (U)Int* or Float*

Returns a named Tuple with 3 elements: minimum_sample_size, detect_range_lower and detect_range_upper. These are respectively: the required sample size, the lower bound of the range of values not detectable with the returned required sample size, calculated as baseline * (1 - mde), and the upper bound of the range of values not detectable with the returned required sample size, calculated as baseline * (1 + mde) (Float64). Tuple(Float64, Float64, Float64)

minSampleSizeConversion(baseline, mde, power, alpha) staticmethod

minSampleSizeConversion(baseline, mde, power, alpha)

  • baseline — Baseline conversion. Float*
  • mde — Minimum detectable effect (MDE) as percentage points (e.g. for a baseline conversion 0.25 the MDE 0.03 means an expected change to 0.25 ± 0.03). Float*
  • power — Required statistical power of a test (1 - probability of Type II error). Float*
  • alpha — Required significance level of a test (probability of Type I error). Float*

Returns a named Tuple with 3 elements: minimum_sample_size, detect_range_lower, detect_range_upper. These are, respectively: the required sample size, the lower bound of the range of values not detectable with the returned required sample size, calculated as baseline - mde, the upper bound of the range of values not detectable with the returned required sample size, calculated as baseline + mde. Tuple(Float64, Float64, Float64)

minus(x, y) staticmethod

minus(x, y)

  • x — Minuend. - y — Subtrahend. x minus y

modulo(a, b) staticmethod

modulo(a, b)

  • a — The dividend - b — The divisor (modulus) The remainder of a % b

moduloLegacy(a, b) staticmethod

moduloLegacy(a, b)

Returns the remainder of the division. (U)Int* or Float*

moduloOrNull(x, y) staticmethod

moduloOrNull(x, y)

Returns the remainder of the division of x by y, or null when the divisor is zero.

moduloOrZero(a, b) staticmethod

moduloOrZero(a, b)

Returns the remainder of a % b, or 0 when the divisor is 0.

monthName(datetime) staticmethod

monthName(datetime)

Returns the name of the month. String

mortonDecode(tuple_size, code) staticmethod

-- Simple mode mortonDecode(tuple_size, code)

-- Expanded mode mortonDecode(range_mask, code)

  • tuple_size — Integer value no more than 8. UInt8/16/32/64
  • range_mask — For the expanded mode, the mask for each argument. The mask is a tuple of unsigned integers. Each number in the mask configures the amount of range shrink. Tuple(UInt8/16/32/64)
  • code — UInt64 code. UInt64

Returns a tuple of the specified size. Tuple(UInt64)

mortonEncode(args) staticmethod

-- Simplified mode mortonEncode(args)

-- Expanded mode mortonEncode(range_mask, args)

  • args — Up to 8 unsigned integers or columns of the aforementioned type. UInt8/16/32/64
  • range_mask — For the expanded mode, the mask for each argument. The mask is a tuple of unsigned integers from 1 - 8. Each number in the mask configures the amount of range shrink. Tuple(UInt8/16/32/64)

Returns a UInt64 code. UInt64

multiFuzzyMatchAllIndices(haystack, distance, pattern1=None, pattern2=None, patternN=None) staticmethod

multiFuzzyMatchAllIndices(haystack, distance, [pattern1, pattern2, ..., patternN])

  • haystack — String in which the search is performed. String
  • distance — The maximum edit distance for fuzzy matching. UInt8
  • pattern — Array of patterns to match against. Array(String)

Returns an array of all indices (starting from 1) that match the haystack within the specified edit distance in any order. Returns an empty array if no matches are found. Array(UInt64)

multiFuzzyMatchAny(haystack, distance, pattern1=None, pattern2=None, patternN=None) staticmethod

multiFuzzyMatchAny(haystack, distance, [pattern1, pattern2, ..., patternN])

  • haystack — String in which the search is performed. String
  • distance — The maximum edit distance for fuzzy matching. UInt8
  • pattern — Optional. An array of patterns to match against. Array(String)

Returns 1 if any pattern matches the haystack within the specified edit distance, otherwise 0. UInt8

multiFuzzyMatchAnyIndex(haystack, distance, pattern1=None, pattern2=None, patternn=None) staticmethod

multiFuzzyMatchAnyIndex(haystack, distance, [pattern1, pattern2, ..., patternn])

  • haystack — String in which the search is performed. String
  • distance — The maximum edit distance for fuzzy matching. UInt8
  • pattern — Array of patterns to match against. Array(String)

Returns the index (starting from 1) of any pattern that matches the haystack within the specified edit distance, otherwise 0. UInt64

multiIf(cond_1, then_1, cond_2, then_2, else_) staticmethod

multiIf(cond_1, then_1, cond_2, then_2, ..., else)

  • cond_N — The N-th evaluated condition which controls if then_N is returned. UInt8 or Nullable(UInt8) or NULL
  • then_N — The result of the function when cond_N is true. - else — The result of the function if none of the conditions is true. Returns the result of then_N for matching cond_N, otherwise returns the else condition.

multiMatchAllIndices(haystack, pattern1=None, pattern2=None, patternn=None) staticmethod

multiMatchAllIndices(haystack, [pattern1, pattern2, ..., patternn])

  • haystack — String in which the search is performed. String
  • pattern — Regular expressions to match against. String

Array of all indices (starting from 1) that match the haystack in any order. Returns an empty array if no matches are found. Array(UInt64)

multiMatchAny(haystack, pattern1, pattern2=None) staticmethod

multiMatchAny(haystack, pattern1[, pattern2, ...])

  • haystack — String in which patterns are searched. String
  • pattern1[, pattern2, ...] — An array of one or more regular expression patterns. Array(String)

Returns 1 if any pattern matches, 0 otherwise. UInt8

multiMatchAnyIndex(haystack, pattern1=None, pattern2=None, patternn=None) staticmethod

multiMatchAnyIndex(haystack, [pattern1, pattern2, ..., patternn])

  • haystack — String in which the search is performed. String
  • pattern — Regular expressions to match against. Array(String)

Returns the index (starting from 1) of the first pattern that matches, or 0 if no match is found. UInt64

multiSearchAllPositions(haystack, needle1, needle2=None) staticmethod

multiSearchAllPositions(haystack, needle1[, needle2, ...])

  • haystack — String in which the search is performed. String
  • needle1[, needle2, ...] — An array of one or more substrings to be searched. Array(String)

Returns array of the starting position in bytes and counting from 1, if the substring was found, 0, if the substring was not found. Array(UInt64)

multiSearchAllPositionsCaseInsensitive(haystack, needle1, needle2=None) staticmethod

multiSearchAllPositionsCaseInsensitive(haystack, needle1[, needle2, ...])

  • haystack — String in which the search is performed. String
  • needle1[, needle2, ...] — An array of one or more substrings to be searched. Array(String)

Returns array of the starting position in bytes and counting from 1 (if the substring was found), 0 if the substring was not found. Array(UInt64)

multiSearchAllPositionsCaseInsensitiveUTF8(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchAllPositionsCaseInsensitiveUTF8(haystack, [needle1, needle2, ..., needleN])

  • haystack — UTF-8 encoded string in which the search is performed. String
  • needle — UTF-8 encoded substrings to be searched. Array(String)

Array of the starting position in bytes and counting from 1 (if the substring was found). Returns 0 if the substring was not found. Array

multiSearchAllPositionsUTF8(haystack, needle1, needle2=None) staticmethod

multiSearchAllPositionsUTF8(haystack, needle1[, needle2, ...])

  • haystack — UTF-8 encoded string in which the search is performed. String
  • needle1[, needle2, ...] — An array of UTF-8 encoded substrings to be searched. Array(String)

Returns array of the starting position in bytes and counting from 1 (if the substring was found), 0 if the substring was not found. Array

multiSearchAny(haystack, needle1, needle2=None) staticmethod

multiSearchAny(haystack, needle1[, needle2, ...])

  • haystack — String in which the search is performed. String
  • needle1[, needle2, ...] — An array of substrings to be searched. Array(String)

Returns 1, if there was at least one match, otherwise 0, if there was not at least one match. UInt8

multiSearchAnyCaseInsensitive(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchAnyCaseInsensitive(haystack, [needle1, needle2, ..., needleN])

  • haystack — String in which the search is performed. String
  • needle — Substrings to be searched. Array(String)

Returns 1, if there was at least one case-insensitive match, otherwise 0, if there was not at least one case-insensitive match. UInt8

multiSearchAnyCaseInsensitiveUTF8(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchAnyCaseInsensitiveUTF8(haystack, [needle1, needle2, ..., needleN])

  • haystack — UTF-8 string in which the search is performed. String
  • needle — UTF-8 substrings to be searched. Array(String)

Returns 1, if there was at least one case-insensitive match, otherwise 0, if there was not at least one case-insensitive match. UInt8

multiSearchAnyUTF8(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchAnyUTF8(haystack, [needle1, needle2, ..., needleN])

  • haystack — UTF-8 string in which the search is performed. String
  • needle — UTF-8 substrings to be searched. Array(String)

Returns 1, if there was at least one match, otherwise 0, if there was not at least one match. UInt8

multiSearchFirstIndex(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchFirstIndex(haystack, [needle1, needle2, ..., needleN])

  • haystack — The string to search in. String
  • needles — Array of strings to search for. Array(String)

Returns the 1-based index (position in the needles array) of the first needle found in the haystack. Returns 0 if no needles are found. The search is case-sensitive. UInt64

multiSearchFirstIndexCaseInsensitive() staticmethod

multiSearchFirstIndexCaseInsensitive(haystack, [needle1, needle2, ..., needleN]

  • haystack — String in which the search is performed. String
  • needle — Substrings to be searched. Array(String)

Returns the index (starting from 1) of the leftmost found needle. Otherwise 0, if there was no match. UInt8

multiSearchFirstIndexCaseInsensitiveUTF8(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchFirstIndexCaseInsensitiveUTF8(haystack, [needle1, needle2, ..., needleN])

  • haystack — The string to search in. String
  • needles — Array of strings to search for. Array(String)

Returns the 1-based index (position in the needles array) of the first needle found in the haystack. Returns 0 if no needles are found. The search is case-insensitive and respects UTF-8 character encoding. UInt64

multiSearchFirstIndexUTF8(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchFirstIndexUTF8(haystack, [needle1, needle2, ..., needleN])

  • haystack — UTF-8 string in which the search is performed. String
  • needle — Array of UTF-8 substrings to be searched. Array(String)

Returns the index (starting from 1) of the leftmost found needle. Otherwise 0, if there was no match. UInt8

multiSearchFirstPosition(haystack, needle1, needle2=None) staticmethod

multiSearchFirstPosition(haystack, needle1[, needle2, ...])

  • haystack — String in which the search is performed. String
  • needle1[, needle2, ...] — An array of one or more substrings to be searched. Array(String)

Returns the leftmost offset in a haystack string which matches any of multiple needle strings, otherwise 0, if there was no match. UInt64

multiSearchFirstPositionCaseInsensitive(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchFirstPositionCaseInsensitive(haystack, [needle1, needle2, ..., needleN])

  • haystack — String in which the search is performed. String
  • needle — Array of substrings to be searched. Array(String)

Returns the leftmost offset in a haystack string which matches any of multiple needle strings. Returns 0, if there was no match. UInt64

multiSearchFirstPositionCaseInsensitiveUTF8(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchFirstPositionCaseInsensitiveUTF8(haystack, [needle1, needle2, ..., needleN])

  • haystack — UTF-8 string in which the search is performed. String
  • needle — Array of UTF-8 substrings to be searched. Array(String)

Returns the leftmost offset in a haystack string which matches any of multiple needle strings, ignoring case. Returns 0, if there was no match. UInt64

multiSearchFirstPositionUTF8(haystack, needle1=None, needle2=None, needleN=None) staticmethod

multiSearchFirstPositionUTF8(haystack, [needle1, needle2, ..., needleN])

  • haystack — UTF-8 string in which the search is performed. String
  • needle — Array of UTF-8 substrings to be searched. Array(String)

Leftmost offset in a haystack string which matches any of multiple needle strings. Returns 0, if there was no match. UInt64

multiply(x, y) staticmethod

multiply(x, y)

Returns the product of x and y

multiplyDecimal(a, b, result_scale=None) staticmethod

multiplyDecimal(a, b[, result_scale])

The result of multiplication with the given scale. Type: Decimal256

murmurHash2_32(arg1, arg2=None) staticmethod

murmurHash2_32(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed hash value of the input arguments. UInt32

murmurHash2_64(arg1, arg2=None) staticmethod

murmurHash2_64(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed hash of the input arguments. UInt64

murmurHash3_128(arg1, arg2=None) staticmethod

murmurHash3_128(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed 128-bit MurmurHash3 hash value of the input arguments. FixedString(16)

murmurHash3_32(arg1, arg2=None) staticmethod

murmurHash3_32(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed hash value of the input arguments. UInt32

murmurHash3_64(arg1, arg2=None) staticmethod

murmurHash3_64(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed hash value of the input arguments. UInt64

naiveBayesClassifier(model_name, input_text) staticmethod

naiveBayesClassifier(model_name, input_text)

  • model_name — Name of the pre-configured model. The model must be defined in ClickHouse's configuration files. String
  • input_text — Text to classify. Input is processed exactly as provided (case/punctuation preserved). String

Predicted class ID as an unsigned integer. Class IDs correspond to categories defined during model construction. UInt32

naturalSortKey(s) staticmethod

naturalSortKey(s)

  • s — A string to convert to natural sort key. String

Returns a natural sort key string from s. String

negate(x) staticmethod

negate(x)

  • x — The value to negate. Returns -x from x

neighbor(column, offset, default_value=None) staticmethod

neighbor(column, offset[, default_value])

  • column — The source column. Any
  • offset — The offset from the current row. Positive values look forward, negative values look backward. Integer
  • default_value — Optional. The value to return if the offset goes beyond the data bounds. If not specified, uses the default value for the column type. Any

Returns a value from the specified offset, or default if out of bounds. Any

nested(*args) staticmethod

netloc(url) staticmethod

netloc(url)

Returns username:password@host:port from a given URL. String

ngramDistance(haystack, needle) staticmethod

ngramDistance(haystack, needle)

  • haystack — String for comparison. String
  • needle — String for comparison. String

Returns a Float32 number between 0 and 1. The smaller the returned value, the more similar the strings are. Float32

ngramDistanceCaseInsensitive(haystack, needle) staticmethod

ngramDistanceCaseInsensitive(haystack, needle)

  • haystack — First comparison string. String
  • needle — Second comparison string. String

Returns a Float32 number between 0 and 1. Float32

ngramDistanceCaseInsensitiveUTF8(haystack, needle) staticmethod

ngramDistanceCaseInsensitiveUTF8(haystack, needle)

  • haystack — First UTF-8 encoded comparison string. String
  • needle — Second UTF-8 encoded comparison string. String

Returns a Float32 number between 0 and 1. Float32

ngramDistanceUTF8(haystack, needle) staticmethod

ngramDistanceUTF8(haystack, needle)

  • haystack — First UTF-8 encoded comparison string. String
  • needle — Second UTF-8 encoded comparison string. String

Returns a Float32 number between 0 and 1. Float32

ngramMinHash(string, ngramsize=None, hashnum=None) staticmethod

ngramMinHash(string[, ngramsize, hashnum])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two hashes — the minimum and the maximum. Tuple

ngramMinHashArg(string, ngramsize=None, hashnum=None) staticmethod

ngramMinHashArg(string[, ngramsize, hashnum])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two tuples with hashnum n-grams each. Tuple(String)

ngramMinHashArgCaseInsensitive(string, ngramsize=None, hashnum=None) staticmethod

ngramMinHashArgCaseInsensitive(string[, ngramsize, hashnum])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two tuples with hashnum n-grams each. Tuple(Tuple(String))

ngramMinHashArgCaseInsensitiveUTF8(string, ngramsize=None, hashnum=None) staticmethod

ngramMinHashArgCaseInsensitiveUTF8(string[, ngramsize, hashnum])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two tuples with hashnum n-grams each. Tuple(Tuple(String))

ngramMinHashArgUTF8(string, ngramsize=None, hashnum=None) staticmethod

ngramMinHashArgUTF8(string[, ngramsize, hashnum])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two tuples with hashnum n-grams each. Tuple(Tuple(String))

ngramMinHashCaseInsensitive(string, ngramsize=None, hashnum=None) staticmethod

ngramMinHashCaseInsensitive(string[, ngramsize, hashnum])

  • string — String. String. - ngramsize — The size of an n-gram. Optional. Possible values: any number from 1 to 25. Default value: 3. UInt8. - hashnum — The number of minimum and maximum hashes used to calculate the result. Optional. Possible values: any number from 1 to 25. Default value: 6. UInt8. Tuple with two hashes — the minimum and the maximum. Tuple(UInt64, UInt64). Tuple

ngramMinHashCaseInsensitiveUTF8(string, ngramsize=None, hashnum=None) staticmethod

ngramMinHashCaseInsensitiveUTF8(string [, ngramsize, hashnum])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two hashes — the minimum and the maximum. Tuple

ngramMinHashUTF8(string, ngramsize=None, hashnum=None) staticmethod

ngramMinHashUTF8(string[, ngramsize, hashnum])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two hashes — the minimum and the maximum. Tuple

ngramSearch(haystack, needle) staticmethod

ngramSearch(haystack, needle)

  • haystack — String for comparison. String
  • needle — String for comparison. String

Returns 1 if the 4-gram distance between the strings is less than or equal to a threshold (1.0 by default), 0 otherwise. UInt8

ngramSearchCaseInsensitive(haystack, needle) staticmethod

ngramSearchCaseInsensitive(haystack, needle)

  • haystack — String for comparison. String
  • needle — String for comparison. String

Returns 1 if the 4-gram distance between the strings is less than or equal to a threshold (1.0 by default), 0 otherwise. UInt8

ngramSearchCaseInsensitiveUTF8(haystack, needle) staticmethod

ngramSearchCaseInsensitiveUTF8(haystack, needle)

  • haystack — UTF-8 string for comparison. String
  • needle — UTF-8 string for comparison. String

Returns 1 if the 3-gram distance between the strings is less than or equal to a threshold (1.0 by default), 0 otherwise. UInt8

ngramSearchUTF8(haystack, needle) staticmethod

ngramSearchUTF8(haystack, needle)

  • haystack — UTF-8 string for comparison. String
  • needle — UTF-8 string for comparison. String

Returns 1 if the 3-gram distance between the strings is less than or equal to a threshold (1.0 by default), 0 otherwise. UInt8

ngramSimHash(string, ngramsize=None) staticmethod

ngramSimHash(string[, ngramsize])

  • string — String for which to compute the case sensitive simhash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is3. UInt8

Returns the computed hash of the input string. UInt64

ngramSimHashCaseInsensitive(string, ngramsize=None) staticmethod

ngramSimHashCaseInsensitive(string[, ngramsize])

  • string — String for which to compute the case insensitive simhash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8

Hash value. UInt64. UInt64

ngramSimHashCaseInsensitiveUTF8(string, ngramsize=None) staticmethod

ngramSimHashCaseInsensitiveUTF8(string[, ngramsize])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8

Returns the computed hash value. UInt64

ngramSimHashUTF8(string, ngramsize=None) staticmethod

ngramSimHashUTF8(string[, ngramsize])

  • string — String for which to compute the hash. String
  • ngramsize — Optional. The size of an n-gram, any number from 1 to 25. The default value is 3. UInt8

Returns the computed hash value. UInt64

ngrams(s, N) staticmethod

ngrams(s, N)

Returns an array with n-grams. Array(String)

nonNegativeDerivative(*args) staticmethod

normalizeQuery(x) staticmethod

normalizeQuery(x)

  • x — Sequence of characters. String

Returns the given sequence of characters with placeholders. String

normalizeQueryKeepNames(x) staticmethod

normalizeQueryKeepNames(x)

  • x — Sequence of characters. String

Returns the given sequence of characters with placeholders. String

normalizeUTF8NFC(str) staticmethod

normalizeUTF8NFC(str)

  • str — UTF-8 encoded input string. String

Returns the NFC normalized form of the UTF-8 string. String

normalizeUTF8NFD(str) staticmethod

normalizeUTF8NFD(str)

  • str — UTF-8 encoded input string. String

Returns the NFD normalized form of the UTF-8 string. String

normalizeUTF8NFKC(str) staticmethod

normalizeUTF8NFKC(str)

  • str — UTF-8 encoded input string. String

Returns the NFKC normalized form of the UTF-8 string. String

normalizeUTF8NFKCCasefold(str) staticmethod

normalizeUTF8NFKCCasefold(str)

  • str — UTF-8 encoded input string. String

Returns the NFKC_Casefold normalized form of the UTF-8 string. String

normalizeUTF8NFKD(str) staticmethod

normalizeUTF8NFKD(str)

  • str — UTF-8 encoded input string. String

Returns the NFKD normalized form of the UTF-8 string. String

normalizedQueryHash(x) staticmethod

normalizedQueryHash(x)

  • x — Sequence of characters. String

Returns a 64 bit hash value. UInt64

normalizedQueryHashKeepNames(x) staticmethod

normalizedQueryHashKeepNames(x)

  • x — Sequence of characters. String

Returns a 64 bit hash value. UInt64

notEmpty(arr) staticmethod

notEmpty(arr)

Returns 1 for a non-empty array or 0 for an empty array UInt8

notEquals(a, b) staticmethod

notEquals(a, b) -- a != b -- a <> b

  • a — First value.* - b — Second value.* Returns 1 if a is not equal to b, otherwise 0. UInt8

notILike(haystack, pattern) staticmethod

notILike(haystack, pattern)

  • haystack — The input string to search in. String or FixedString
  • pattern — The SQL LIKE pattern to match against. % matches any number of characters (including zero), _ matches exactly one character. String

Returns 1 if the string does not match the pattern (case-insensitive), otherwise 0. UInt8

notIn(x, set) staticmethod

notIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is not in the set, 0 otherwise. UInt8

notInIgnoreSet(x, set) staticmethod

notIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is not in the set, 0 otherwise. UInt8

notLike(haystack, pattern) staticmethod

notLike(haystack, pattern) -- haystack NOT LIKE pattern

  • haystack — String in which the search is performed. String or FixedString
  • pattern — LIKE pattern to match against. String

Returns 1 if the string does not match the LIKE pattern, otherwise 0. UInt8

notNullIn(x, set) staticmethod

notNullIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is not in the set, 0 otherwise. UInt8

notNullInIgnoreSet(x, set) staticmethod

notNullIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is not in the set, 0 otherwise. UInt8

not_(val) staticmethod

not(val)

Returns: - 1, if val evaluates to false - 0, if val evaluates to true - NULL, if val is NULL. Nullable(UInt8)

nothing(*args) staticmethod

nothingNull(*args) staticmethod

nothingUInt64(*args) staticmethod

now(timezone=None) staticmethod

now([timezone])

  • timezone — Optional. Timezone name for the returned value. String

Returns the current date and time. DateTime

now64(scale=None, timezone=None) staticmethod

now64([scale[, timezone]])

  • scale — Optional. Tick size (precision): 10^-precision seconds. Valid range: [0 : 9]. Typically, are used - 3 (default) (milliseconds), 6 (microseconds), 9 (nanoseconds). UInt8
  • timezone — Optional. Timezone name for the returned value. String

Returns current date and time with sub-second precision. DateTime64

nowInBlock(timezone=None) staticmethod

nowInBlock([timezone])

  • timezone — Optional. Timezone name for the returned value. String

Returns the current date and time at the moment of processing of each block of data. DateTime

nowInBlock64(scale=None, timezone=None) staticmethod

nowInBlock64([scale[, timezone]])

  • scale — Optional. Tick size (precision): 10^-precision seconds. Valid range: [0 : 9]. Typically, are used - 3 (default) (milliseconds), 6 (microseconds), 9 (nanoseconds). UInt8
  • timezone — Optional. Timezone name for the returned value. String

Returns the current date and time at the moment of processing of each block of data with sub-second precision. DateTime64

nth_value(*args) staticmethod

ntile(*args) staticmethod

nullIf(x, y) staticmethod

nullIf(x, y)

  • x — The first value. Any
  • y — The second value. Any

Returns NULL if both arguments are equal, otherwise returns the first argument. NULL or Nullable(x)

nullIn(x, set) staticmethod

nullIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is in the set, 0 otherwise. UInt8

nullInIgnoreSet(x, set) staticmethod

nullIn(x, set)

  • x — The value to check. - set — The set of values. Returns 1 if x is in the set, 0 otherwise. UInt8

numericIndexedVectorAllValueSum(v) staticmethod

numericIndexedVectorAllValueSum(v)

Returns the sum. Float64

numericIndexedVectorBuild(map) staticmethod

numericIndexedVectorBuild(map)

  • map — A mapping from index to value. Map

Returns a NumericIndexedVector object. AggregateFunction

numericIndexedVectorCardinality(v) staticmethod

numericIndexedVectorCardinality(v)

Returns the number of unique indexes. UInt64

numericIndexedVectorGetValue(v, i) staticmethod

numericIndexedVectorGetValue(v, i)

A numeric value with the same type as the value type of NumericIndexedVector. (U)Int* or Float*

numericIndexedVectorPointwiseAdd(v1, v2) staticmethod

numericIndexedVectorPointwiseAdd(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseDivide(v1, v2) staticmethod

numericIndexedVectorPointwiseDivide(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseEqual(v1, v2) staticmethod

numericIndexedVectorPointwiseEqual(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseGreater(v1, v2) staticmethod

numericIndexedVectorPointwiseGreater(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseGreaterEqual(v1, v2) staticmethod

numericIndexedVectorPointwiseGreaterEqual(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseLess(v1, v2) staticmethod

numericIndexedVectorPointwiseLess(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseLessEqual(v1, v2) staticmethod

numericIndexedVectorPointwiseLessEqual(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseMultiply(v1, v2) staticmethod

numericIndexedVectorPointwiseMultiply(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseNotEqual(v1, v2) staticmethod

numericIndexedVectorPointwiseNotEqual(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorPointwiseSubtract(v1, v2) staticmethod

numericIndexedVectorPointwiseSubtract(v1, v2)

Returns a new numericIndexedVector object. numericIndexedVector

numericIndexedVectorShortDebugString(v) staticmethod

numericIndexedVectorShortDebugString(v)

Returns a JSON string containing debug information. String

numericIndexedVectorToMap(v) staticmethod

numericIndexedVectorToMap(v)

Returns a map with index-value pairs. Map

or_(val1, val2) staticmethod

or(val1, val2[, ...])

Returns: - 1, if at least one argument evaluates to true - 0, if all arguments evaluate to false - NULL, if all arguments evaluate to false and at least one argument is NULL Nullable(UInt8)

overlay(s, replace, offset, length=None) staticmethod

overlay(s, replace, offset[, length])

  • s — The input string. String
  • replace — The replacement string const String
  • offset — An integer type Int (1-based). If offset is negative, it is counted from the end of the string s. Int
  • length — Optional. An integer type Int. length specifies the length of the snippet within the input string s to be replaced. If length is not specified, the number of bytes removed from s equals the length of replace; otherwise length bytes are removed. Int

Returns a string with replacement. String

overlayUTF8(s, replace, offset, length=None) staticmethod

overlayUTF8(s, replace, offset[, length])

  • s — The input string. String
  • replace — The replacement string. const String
  • offset — An integer type Int (1-based). If offset is negative, it is counted from the end of the input string s. (U)Int*
  • length — Optional. Specifies the length of the snippet within the input string s to be replaced. If length is not specified, the number of characters removed from s equals the length of replace, otherwise length characters are removed. (U)Int*

Returns a string with replacement. String

parseDateTime(time_string, format, timezone=None) staticmethod

parseDateTime(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime. String
  • format — Format string specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns a DateTime parsed from the input string according to the MySQL style format string. DateTime

parseDateTime32BestEffort(time_string, time_zone=None) staticmethod

parseDateTime32BestEffort(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed String

Returns time_string as a DateTime. DateTime

parseDateTime32BestEffortOrNull(time_string, time_zone=None) staticmethod

parseDateTime32BestEffortOrNull(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed. String

Returns a DateTime object parsed from the string, or NULL if the parsing fails. DateTime

parseDateTime32BestEffortOrZero(time_string, time_zone=None) staticmethod

parseDateTime32BestEffortOrZero(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed. String

Returns a DateTime object parsed from the string, or zero date (1970-01-01 00:00:00) if the parsing fails. DateTime

parseDateTime64(time_string, format, timezone=None) staticmethod

parseDateTime64(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime64. String
  • format — Format string specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns a DateTime64 parsed from the input string according to the MySQL style format string. DateTime64

parseDateTime64BestEffort(time_string, precision=None, time_zone=None) staticmethod

parseDateTime64BestEffort(time_string[, precision[, time_zone]])

  • time_string — String containing a date or date with time to convert. String
  • precision — Optional. Required precision. 3 for milliseconds, 6 for microseconds. Default: 3. UInt8
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns time_string converted to the DateTime64 data type. DateTime64

parseDateTime64BestEffortOrNull(time_string, precision=None, time_zone=None) staticmethod

parseDateTime64BestEffortOrNull(time_string[, precision[, time_zone]])

  • time_string — String containing a date or date with time to convert. String
  • precision — Optional. Required precision. 3 for milliseconds, 6 for microseconds. Default: 3. UInt8
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns time_string converted to DateTime64, or NULL if the input cannot be parsed. DateTime64 or NULL

parseDateTime64BestEffortOrZero(time_string, precision=None, time_zone=None) staticmethod

parseDateTime64BestEffortOrZero(time_string[, precision[, time_zone]])

  • time_string — String containing a date or date with time to convert. String
  • precision — Optional. Required precision. 3 for milliseconds, 6 for microseconds. Default: 3. UInt8
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns time_string converted to DateTime64, or zero date/datetime (1970-01-01 00:00:00.000) if the input cannot be parsed. DateTime64

parseDateTime64BestEffortUS(time_string, precision=None, time_zone=None) staticmethod

parseDateTime64BestEffortUS(time_string [, precision [, time_zone]])

  • time_string — String containing a date or date with time to convert. String
  • precision — Optional. Required precision. 3 for milliseconds, 6 for microseconds. Default: 3. UInt8
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns time_string converted to DateTime64 using US date format preference for ambiguous cases. DateTime64

parseDateTime64BestEffortUSOrNull(time_string, precision=None, time_zone=None) staticmethod

parseDateTime64BestEffortUSOrNull(time_string[, precision[, time_zone]])

  • time_string — String containing a date or date with time to convert. String
  • precision — Optional. Required precision. 3 for milliseconds, 6 for microseconds. Default: 3. UInt8
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns time_string converted to DateTime64 using US format preference, or NULL if the input cannot be parsed. DateTime64 or NULL

parseDateTime64BestEffortUSOrZero(time_string, precision=None, time_zone=None) staticmethod

parseDateTime64BestEffortUSOrZero(time_string [, precision [, time_zone]])

  • time_string — String containing a date or date with time to convert. String
  • precision — Optional. Required precision. 3 for milliseconds, 6 for microseconds. Default: 3. UInt8
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns time_string converted to DateTime64 using US format preference, or zero date/datetime (1970-01-01 00:00:00.000) if the input cannot be parsed. DateTime64

parseDateTime64InJodaSyntax(time_string, format, timezone=None) staticmethod

parseDateTime64InJodaSyntax(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime64. String
  • format — Format string in Joda syntax specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns a DateTime64 parsed from the input string according to the Joda style format string. DateTime64

parseDateTime64InJodaSyntaxOrNull(time_string, format, timezone=None) staticmethod

parseDateTime64InJodaSyntaxOrNull(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime64. String
  • format — Format string in Joda syntax specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns DateTime64 parsed from input string, or NULL if parsing fails. Nullable(DateTime64)

parseDateTime64InJodaSyntaxOrZero(time_string, format, timezone=None) staticmethod

parseDateTime64InJodaSyntaxOrZero(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime64. String
  • format — Format string in Joda syntax specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns DateTime64 parsed from input string, or zero DateTime64 if parsing fails. DateTime64

parseDateTime64OrNull(time_string, format, timezone=None) staticmethod

parseDateTime64OrNull(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime64. String
  • format — Format string specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns DateTime64 parsed from input string, or NULL if parsing fails. Nullable(DateTime64)

parseDateTime64OrZero(time_string, format, timezone=None) staticmethod

parseDateTime64OrZero(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime64. String
  • format — Format string specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns DateTime64 parsed from input string, or zero DateTime64 if parsing fails. DateTime64

parseDateTimeBestEffort(time_string, time_zone=None) staticmethod

parseDateTimeBestEffort(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed. String

Returns time_string as a DateTime. DateTime

parseDateTimeBestEffortOrNull(time_string, time_zone=None) staticmethod

parseDateTimeBestEffortOrNull(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed. String

Returns time_string as a DateTime, or NULL if the input cannot be parsed. DateTime or NULL

parseDateTimeBestEffortOrZero(time_string, time_zone=None) staticmethod

parseDateTimeBestEffortOrZero(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed. String

Returns time_string as a DateTime, or zero date/datetime (1970-01-01 or 1970-01-01 00:00:00) if the input cannot be parsed. DateTime

parseDateTimeBestEffortUS(time_string, time_zone=None) staticmethod

parseDateTimeBestEffortUS(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed. String

Returns time_string as a DateTime using US date format preference for ambiguous cases. DateTime

parseDateTimeBestEffortUSOrNull(time_string, time_zone=None) staticmethod

parseDateTimeBestEffortUSOrNull(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed. String

Returns time_string as a DateTime using US format preference, or NULL if the input cannot be parsed. DateTime or NULL

parseDateTimeBestEffortUSOrZero(time_string, time_zone=None) staticmethod

parseDateTimeBestEffortUSOrZero(time_string[, time_zone])

  • time_string — String containing a date and time to convert. String
  • time_zone — Optional. Time zone according to which time_string is parsed. String

Returns time_string as a DateTime using US format preference, or zero date/datetime (1970-01-01 or 1970-01-01 00:00:00) if the input cannot be parsed. DateTime

parseDateTimeInJodaSyntax(time_string, format, timezone=None) staticmethod

parseDateTimeInJodaSyntax(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime. String
  • format — Format string in Joda syntax specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns a DateTime parsed from the input string according to the Joda style format string. DateTime

parseDateTimeInJodaSyntaxOrNull(time_string, format, timezone=None) staticmethod

parseDateTimeInJodaSyntaxOrNull(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime. String
  • format — Format string in Joda syntax specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns DateTime parsed from input string, or NULL if parsing fails. Nullable(DateTime)

parseDateTimeInJodaSyntaxOrZero(time_string, format, timezone=None) staticmethod

parseDateTimeInJodaSyntaxOrZero(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime. String
  • format — Format string in Joda syntax specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns DateTime parsed from input string, or zero DateTime if parsing fails. DateTime

parseDateTimeOrNull(time_string, format, timezone=None) staticmethod

parseDateTimeOrNull(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime. String
  • format — Format string specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns DateTime parsed from input string, or NULL if parsing fails. Nullable(DateTime)

parseDateTimeOrZero(time_string, format, timezone=None) staticmethod

parseDateTimeOrZero(time_string, format[, timezone])

  • time_string — String to be parsed into DateTime. String
  • format — Format string specifying how to parse time_string. String
  • timezone — Optional. Timezone. String

Returns DateTime parsed from input string, or zero DateTime if parsing fails. DateTime

parseReadableSize(x) staticmethod

parseReadableSize(x)

  • x — Readable size with ISO/IEC 80000-13 or decimal byte unit. String

Returns the number of bytes, rounded up to the nearest integer. UInt64

parseReadableSizeOrNull(x) staticmethod

parseReadableSizeOrNull(x)

  • x — Readable size with ISO/IEC 80000-13 or decimal byte unit. String

Returns the number of bytes, rounded up to the nearest integer, or NULL if unable to parse the input Nullable(UInt64)

parseReadableSizeOrZero(x) staticmethod

parseReadableSizeOrZero(x)

  • x — Readable size with ISO/IEC 80000-13 or decimal byte unit. String

Returns the number of bytes, rounded up to the nearest integer, or 0 if unable to parse the input. UInt64

parseTimeDelta(timestr) staticmethod

parseTimeDelta(timestr)

  • timestr — A sequence of numbers followed by something resembling a time unit. String

The number of seconds. Float64

partitionId(column1, column2=None) staticmethod

partitionId(column1[, column2, ...])

  • column1, column2, ... — Column for which to return the partition ID. Returns the partition ID that the row belongs to. String

path(url) staticmethod

path(url)

Returns the path of the URL without query string. String

pathFull(url) staticmethod

pathFull(url)

Returns the path of the URL including query string and fragment. String

percentRank(*args) staticmethod

perimeterCartesian(object) staticmethod

perimeterCartesian(object)

  • object — geometry object Variant

Returns the perimeter of the object. Float64

perimeterSpherical(object) staticmethod

perimeterSpherical(object)

  • object — geometry object Variant

Returns the perimeter of the object. Float64

pi() staticmethod

pi()

Returns pi Float64

plus(x, y) staticmethod

plus(x, y)

  • x — Left hand operand. - y — Right hand operand. Returns the sum of x and y

pointInPolygon(x, y) staticmethod

pointInPolygon((x, y), [(a, b), (c, d) ...], ...)

Returns 1 if the point is inside the polygon, 0 if it is not. If the point is on the polygon boundary, the function may return either 0 or 1. UInt8

polygonAreaCartesian(polygon) staticmethod

polygonAreaCartesian(polygon)

  • polygon — A polygon value Polygon

Returns the area of the polygon Float64

polygonAreaSpherical(polygon) staticmethod

polygonAreaSpherical(polygon)

  • polygon — A polygon value. Polygon

Returns the surface area of the polygon Float64

polygonConvexHullCartesian(multipolygon) staticmethod

polygonConvexHullCartesian(multipolygon)

Returns the convex hull as a Polygon. Polygon

polygonPerimeterCartesian(polygon) staticmethod

polygonPerimeterCartesian(polygon)

  • polygon — A Polygon value. Polygon

Returns the perimeter of the polygon. Float64

polygonPerimeterSpherical(polygon) staticmethod

polygonPerimeterSpherical(polygon)

  • polygon — A value of type Polygon The perimeter of the polygon on a sphere Float64

polygonsDistanceCartesian(polygon1, polygon2) staticmethod

polygonsDistanceCartesian(polygon1, polygon2)

  • polygon1 — A Polygon value Polygon
  • polygon2 — A Polygon value Polygon

Returns the minimal distance between the two polygons Float64

polygonsDistanceSpherical(polygon1, polygon2) staticmethod

polygonsDistanceSpherical(polygon1, polygon2)

  • polygon1 — The first Polygon value. Polygon
  • polygon2 — The second Polygon value. Polygon

Returns the minimal distance between the two polygons on a sphere Float64

polygonsEqualsCartesian(polygon1, polygon2) staticmethod

polygonsEqualsCartesian(polygon1, polygon2)

  • polygon1 — The first Polygon. Polygon
  • polygon2 — The second Polygon. Polygon

Returns 1 if equal, otherwise 0. UInt8

polygonsIntersectCartesian(polygon1, polygon2) staticmethod

polygonsIntersectCartesian(polygon1, polygon2)

polygonsIntersectSpherical(polygon1, polygon2) staticmethod

polygonsIntersectSpherical(polygon1, polygon2)

polygonsIntersectionCartesian(polygon1, polygon2) staticmethod

polygonsIntersectionCartesian(polygon1, polygon2)

  • polygon1 — The first Polygon. Polygon
  • polygon2 — The second Polygon. Polygon

Returns the intersection of the polygons as a MultiPolygon. MultiPolygon

polygonsIntersectionSpherical(polygon1, polygon2) staticmethod

polygonsIntersectionSpherical(polygon1, polygon2)

  • polygon1 — First Polygon with spherical coordinates. Polygon
  • polygon2 — Second Polygon with spherical coordinates. Polygon

Returns the intersection of the polygons as a MultiPolygon. MultiPolygon

polygonsSymDifferenceCartesian(polygon1, polygon2) staticmethod

polygonsSymDifferenceCartesian(polygon1, polygon2)

  • polygon1 — The first Polygon. Polygon
  • polygon2 — The second Polygon Polygon

Returns the symmetric difference of the polygons as a MultiPolygon. MultiPolygon

polygonsSymDifferenceSpherical(polygon1, polygon2) staticmethod

polygonsSymDifferenceSpherical(polygon1, polygon2)

  • polygon1 — The first Polygon. Polygon
  • polygon2 — The second Polygon Polygon

Returns the symmetric difference of the polygons as a MultiPolygon. MultiPolygon

polygonsUnionCartesian(polygon1, polygon2) staticmethod

polygonsUnionCartesian(polygon1, polygon2)

  • polygon1 — The first Polygon. Polygon
  • polygon2 — The second Polygon. Polygon

Returns the union of the polygons as a MultiPolygon. MultiPolygon

polygonsUnionSpherical(polygon1, polygon2) staticmethod

polygonsUnionSpherical(polygon1, polygon2)

  • polygon1 — The first Polygon. Polygon
  • polygon2 — The second Polygon. Polygon

Returns the union of the polygons as a MultiPolygon. MultiPolygon

polygonsWithinCartesian(polygon1, polygon2) staticmethod

polygonsWithinCartesian(polygon1, polygon2)

  • polygon1 — The first polygon. Polygon
  • polygon2 — The second polygon. Polygon

Returns 1 if polygon1 is contained in polygon2, otherwise 0. UInt8

polygonsWithinSpherical(polygon1, polygon2) staticmethod

polygonsWithinSpherical(polygon1, polygon2)

  • polygon1 — The first Polygon. Polygon
  • polygon2 — The second Polygon. Polygon

Returns 1 if polygon1 lies completely within polygon2, otherwise 0. UInt8

port(url, default_port=None) staticmethod

port(url[, default_port])

  • url — URL. String
  • default_port — Optional. The default port number to be returned. 0 by default. UInt16

Returns the port of the URL, or the default port if there is no port in the URL or in case of a validation error. UInt16

portRFC(url, default_port=None) staticmethod

portRFC(url[, default_port])

  • url — URL. String
  • default_port — Optional. The default port number to be returned. 0 by default. UInt16

Returns the port or the default port if there is no port in the URL or in case of a validation error. UInt16

position(haystack, needle, start_pos=None) staticmethod

position(haystack, needle[, start_pos])

  • haystack — String in which the search is performed. String or Enum
  • needle — Substring to be searched. String
  • start_pos — Position (1-based) in haystack at which the search starts. Optional. UInt

Returns starting position in bytes and counting from 1, if the substring was found, otherwise 0, if the substring was not found. UInt64

positionCaseInsensitive(haystack, needle, start_pos=None) staticmethod

positionCaseInsensitive(haystack, needle[, start_pos])

  • haystack — String in which the search is performed. String or Enum
  • needle — Substring to be searched. String
  • start_pos — Optional. Position (1-based) in haystack at which the search starts. UInt*

Returns starting position in bytes and counting from 1, if the substring was found, otherwise 0, if the substring was not found. UInt64

positionCaseInsensitiveUTF8(haystack, needle, start_pos=None) staticmethod

positionCaseInsensitiveUTF8(haystack, needle[, start_pos])

  • haystack — String in which the search is performed. String or Enum
  • needle — Substring to be searched. String
  • start_pos — Optional. Position (1-based) in haystack at which the search starts. UInt*

Returns starting position in bytes and counting from 1, if the substring was found, otherwise 0, if the substring was not found. UInt64

positionUTF8(haystack, needle, start_pos=None) staticmethod

positionUTF8(haystack, needle[, start_pos])

  • haystack — String in which the search is performed. String or Enum
  • needle — Substring to be searched. String
  • start_pos — Optional. Position (1-based) in haystack at which the search starts. UInt*

Returns starting position in bytes and counting from 1, if the substring was found, otherwise 0, if the substring was not found. UInt64

positiveModulo(x, y) staticmethod

positiveModulo(x, y)

Returns the difference between x and the nearest integer not greater than x divisible by y.

positiveModuloOrNull(x, y) staticmethod

positiveModuloOrNull(x, y)

  • x — The dividend. (U)Int*/Float32/64. - x — The divisor (modulus). (U)Int*/Float32/64. Returns the difference between x and the nearest integer not greater than x divisible by y, null when the divisor is zero.

pow(x, y) staticmethod

pow(x, y)

Returns x^y Float64

printf(format, sub1=None, sub2=None) staticmethod

printf(format[, sub1, sub2, ...])

  • format — The format string with % specifiers. String
  • sub1, sub2, ... — Optional. Zero or more values to substitute into the format string. Any

Returns a formatted string. String

proportionsZTest(successes_x, successes_y, trials_x, trials_y, conf_level, pool_type) staticmethod

proportionsZTest(successes_x, successes_y, trials_x, trials_y, conf_level, pool_type)

  • successes_x — Number of successes in population x. UInt64
  • successes_y — Number of successes in population y. UInt64
  • trials_x — Number of trials in population x. UInt64
  • trials_y — Number of trials in population y. UInt64
  • conf_level — Confidence level for the test. Float64
  • pool_type — Selection of pooling method for standard error estimation. Can be either 'unpooled' or 'pooled'. String

Returns a tuple containing: z_stat (Z statistic), p_val (P value), ci_low (lower confidence interval), ci_high (upper confidence interval). Tuple(Float64, Float64, Float64, Float64)

protocol(url) staticmethod

protocol(url)

Returns the protocol of the URL, or an empty string if it cannot be determined. String

punycodeDecode(s) staticmethod

punycodeDecode(s)

  • s — Punycode-encoded string. String

Returns the plaintext of the input value. String

punycodeEncode(s) staticmethod

punycodeEncode(s)

Returns a Punycode representation of the input value. String

quantile(level) staticmethod

quantile(level)(expr)

Approximate quantile of the specified level. Float64 or Date or DateTime

quantileBFloat16(level) staticmethod

quantileBFloat16(level)

Approximate quantile of the specified level. Float64

quantileBFloat16Weighted(level) staticmethod

quantileBFloat16Weighted(level)(expr, weight)

Approximate quantile of the specified level. Float64

quantileDD(relative_accuracy, level=None) staticmethod

quantileDD(relative_accuracy, [level])(expr)

Approximate quantile of the specified level. Float64

quantileDeterministic(level) staticmethod

quantileDeterministic(level)(expr, determinator)

  • expr — Expression over the column values resulting in numeric data types, Date or DateTime. (U)Int* or Float* or Decimal* or Date or DateTime
  • determinator — Number whose hash is used instead of a random number generator in the reservoir sampling algorithm to make the result of sampling deterministic. As a determinator you can use any deterministic positive number, for example, a user id or an event id. If the same determinator value occurs too often, the function works incorrectly. (U)Int*

Returns an approximate quantile of the specified level. Float64 or Date or DateTime

quantileExact(level) staticmethod

quantileExact(level)(expr)

Quantile of the specified level. For numeric data types the output format will be the same as the input format. (U)Int* or Float* or Decimal* or Date or DateTime

quantileExactExclusive(level) staticmethod

quantileExactExclusive(level)(expr)

Returns the quantile of the specified level. Float64

quantileExactHigh(level) staticmethod

quantileExactHigh(level)(expr)

Returns the quantile of the specified level. Float64 or Date or DateTime

quantileExactInclusive(level) staticmethod

quantileExactInclusive(level)(expr)

Returns the quantile of the specified level. Float64

quantileExactLow(level) staticmethod

quantileExactLow(level)(expr)

Returns the quantile of the specified level. Float64 or Date or DateTime

quantileExactWeighted(level) staticmethod

quantileExactWeighted(level)(expr, weight)

  • expr — Expression over the column values resulting in numeric data types, Date or DateTime. (U)Int* or Float* or Decimal* or Date or DateTime
  • weight — Column with weights of sequence members. Weight is a number of value occurrences. UInt*

Quantile of the specified level. Float64 or Date or DateTime

quantileExactWeightedInterpolated(level) staticmethod

quantileExactWeightedInterpolated(level)(expr, weight)

  • expr — Expression over the column values resulting in numeric data types, Date or DateTime. (U)Int* or Float* or Decimal* or Date or DateTime
  • weight — Column with weights of sequence members. Weight is a number of value occurrences. UInt*

Quantile of the specified level. Float64 or Date or DateTime

quantileGK(accuracy, level) staticmethod

quantileGK(accuracy, level)(expr)

Returns the quantile of the specified level and accuracy. Float64 or Date or DateTime

quantileInterpolatedWeighted(level) staticmethod

quantileInterpolatedWeighted(level)(expr, weight)

  • expr — Expression over the column values resulting in numeric data types, Date or DateTime. (U)Int* or Float* or Decimal* or Date or DateTime
  • weight — Column with weights of sequence members. Weight is a number of value occurrences. UInt*

Quantile of the specified level. Float64 or Date or DateTime

quantilePrometheusHistogram(level) staticmethod

quantilePrometheusHistogram(level)(bucket_upper_bound, cumulative_bucket_value)

  • bucket_upper_bound — Upper bounds of the histogram buckets. The highest bucket must have an upper bound of +Inf. Float64
  • cumulative_bucket_value — Cumulative values of the histogram buckets. Values must be monotonically increasing as the bucket upper bound increases. (U)Int* or Float64

Returns the quantile of the specified level. Float64

quantileTDigest(level) staticmethod

quantileTDigest(level)(expr)

Approximate quantile of the specified level. Float64 or Date or DateTime

quantileTDigestWeighted(level) staticmethod

quantileTDigestWeighted(level)(expr, weight)

  • expr — Expression over the column values resulting in numeric data types, Date or DateTime. (U)Int* or Float* or Decimal* or Date or DateTime
  • weight — Column with weights of sequence elements. Weight is a number of value occurrences. UInt*

Approximate quantile of the specified level. Float64 or Date or DateTime

quantileTiming(level) staticmethod

quantileTiming(level)(expr)

  • expr — Expression over a column values returning a Float*-type number. If negative values are passed to the function, the behavior is undefined. If the value is greater than 30,000 (a page loading time of more than 30 seconds), it is assumed to be 30,000. Float*

Quantile of the specified level. If no values are passed to the function (when using quantileTimingIf), NaN is returned. The purpose of this is to differentiate these cases from cases that result in zero. Float32

quantileTimingWeighted(level) staticmethod

quantileTimingWeighted(level)(expr, weight)

  • expr — Expression over a column values returning a Float*-type number. If negative values are passed to the function, the behavior is undefined. If the value is greater than 30,000 (a page loading time of more than 30 seconds), it is assumed to be 30,000. Float*
  • weight — Column with weights of sequence elements. Weight is a number of value occurrences. UInt*

Quantile of the specified level. Float32

quantiles(level1, level2) staticmethod

quantiles(level1, level2, ...)(expr)

Array of approximate quantiles of the specified levels in the same order as the levels were specified. Array(Float64) or Array(Date) or Array(DateTime)

quantilesBFloat16(*args) staticmethod

quantilesBFloat16Weighted(*args) staticmethod

quantilesDD(*args) staticmethod

quantilesDeterministic(*args) staticmethod

quantilesExact(*args) staticmethod

quantilesExactExclusive(level1, level2) staticmethod

quantilesExactExclusive(level1, level2, ...)(expr)

Array of quantiles of the specified levels in the same order as the levels were specified. Array(Float64)

quantilesExactHigh(*args) staticmethod

quantilesExactInclusive(level1, level2) staticmethod

quantilesExactInclusive(level1, level2, ...)(expr)

Array of quantiles of the specified levels in the same order as the levels were specified. Array(Float64)

quantilesExactLow(*args) staticmethod

quantilesExactWeighted(*args) staticmethod

quantilesExactWeightedInterpolated(*args) staticmethod

quantilesGK(accuracy, level1, level2) staticmethod

quantilesGK(accuracy, level1, level2, ...)(expr)

Array of quantiles of the specified levels in the same order as the levels were specified. Array(Float64) or Array(Date) or Array(DateTime)

quantilesInterpolatedWeighted(*args) staticmethod

quantilesPrometheusHistogram(level) staticmethod

quantilePrometheusHistogram(level)(bucket_upper_bound, cumulative_bucket_value)

  • bucket_upper_bound — Upper bounds of the histogram buckets. The highest bucket must have an upper bound of +Inf. Float64
  • cumulative_bucket_value — Cumulative values of the histogram buckets. Values must be monotonically increasing as the bucket upper bound increases. (U)Int* or Float64

Returns the quantile of the specified level. Float64

quantilesTDigest(level1, level2) staticmethod

quantilesTDigest(level1, level2, ...)(expr)

Array of approximate quantiles of the specified levels in the same order as the levels were specified. Array(Float64) or Array(Date) or Array(DateTime)

quantilesTDigestWeighted(level1, level2) staticmethod

quantilesTDigestWeighted(level1, level2, ...)(expr, weight)

  • expr — Expression over the column values resulting in numeric data types, Date or DateTime. (U)Int* or Float* or Decimal* or Date or DateTime
  • weight — Column with weights of sequence elements. Weight is a number of value occurrences. UInt*

Array of approximate quantiles of the specified levels in the same order as the levels were specified. Array(Float64) or Array(Date) or Array(DateTime)

quantilesTiming(level1, level2) staticmethod

quantilesTiming(level1, level2, ...)(expr)

  • expr — Expression over a column values returning a Float*-type number. If negative values are passed to the function, the behavior is undefined. If the value is greater than 30,000 (a page loading time of more than 30 seconds), it is assumed to be 30,000. Float*

Array of quantiles of the specified levels in the same order as the levels were specified. Array(Float32)

quantilesTimingWeighted(level1, level2) staticmethod

quantilesTimingWeighted(level1, level2, ...)(expr, weight)

  • expr — Expression over a column values returning a Float*-type number. If negative values are passed to the function, the behavior is undefined. If the value is greater than 30,000 (a page loading time of more than 30 seconds), it is assumed to be 30,000. Float*
  • weight — Column with weights of sequence elements. Weight is a number of value occurrences. UInt*

Array of quantiles of the specified levels in the same order as the levels were specified. Array(Float32)

queryID() staticmethod

queryID()

Returns the ID of the current query. String

queryString(url) staticmethod

queryString(url)

Returns the query string of the URL without the initial question mark and fragment. String

queryStringAndFragment(url) staticmethod

queryStringAndFragment(url)

Returns the query string and fragment identifier of the URL. String

radians(x) staticmethod

radians(x)

Returns value in radians Float64

rand(x=None) staticmethod

rand([x])

  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random number of type UInt32. UInt32

rand64(x=None) staticmethod

rand64([x])

  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random UInt64 number with uniform distribution. UInt64

randBernoulli(probability, x=None) staticmethod

randBernoulli(probability[, x])

  • probability — The probability of success as a value between 0 and 1. Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified Bernoulli distribution. UInt64

randBinomial(experiments, probability, x=None) staticmethod

randBinomial(experiments, probability[, x])

  • experiments — The number of experiments UInt64
  • probability — The probability of success in each experiment as a value between 0 and 1 Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified binomial distribution. UInt64

randCanonical(x=None) staticmethod

randCanonical([x])

  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number. Float64

randChiSquared(degree_of_freedom, x=None) staticmethod

randChiSquared(degree_of_freedom[, x])

  • degree_of_freedom — Degrees of freedom. Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified chi-square distribution. Float64

randConstant(x=None) staticmethod

randConstant([x])

  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a column of type UInt32 containing the same random value in each row. UInt32

randExponential(lambda_, x=None) staticmethod

randExponential(lambda[, x])

  • lambda — Rate parameter or lambda value of the distribution Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified exponential distribution. Float64

randFisherF(d1, d2, x=None) staticmethod

randFisherF(d1, d2[, x])

  • d1 — d1 degree of freedom in X = (S1 / d1) / (S2 / d2). Float64
  • d2 — d2 degree of freedom in X = (S1 / d1) / (S2 / d2). Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified F-distribution Float64

randLogNormal(mean, stddev, x=None) staticmethod

randLogNormal(mean, stddev[, x])

  • mean — The mean value of distribution. Float64
  • stddev — The standard deviation of the distribution. Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified log-normal distribution. Float64

randNegativeBinomial(experiments, probability, x=None) staticmethod

randNegativeBinomial(experiments, probability[, x])

  • experiments — The number of experiments. UInt64
  • probabilityThe probability of failure in each experiment as a value between0and1. [Float64`](https://clickhouse.com/docs/sql-reference/data-types/float)
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified negative binomial distribution UInt64

randNormal(mean, stddev, x=None) staticmethod

randNormal(mean, stddev[, x])

  • mean — The mean value of distribution Float64
  • stddev — The standard deviation of the distribution Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified normal distribution. Float64

randPoisson(n, x=None) staticmethod

randPoisson(n[, x])

  • n — The mean number of occurrences. UInt64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified Poisson distribution. UInt64

randStudentT(degree_of_freedom, x=None) staticmethod

randStudentT(degree_of_freedom[, x])

  • degree_of_freedom — Degrees of freedom. Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random Float64 number drawn from the specified Student's t-distribution. Float64

randUniform(min, max, x=None) staticmethod

randUniform(min, max[, x])

  • min — Left boundary of the range (inclusive). Float64
  • max — Right boundary of the range (inclusive). Float64
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a random number drawn uniformly from the interval formed by min and max. Float64

randomFixedString(length) staticmethod

randomFixedString(length)

  • length — Length of the string in bytes. UInt*

Returns a string filled with random bytes. FixedString

randomPrintableASCII(length, x=None) staticmethod

randomPrintableASCII(length[, x])

  • length — String length in bytes. (U)Int*
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a string with a random set of ASCII printable characters. String

randomString(length, x=None) staticmethod

randomString(length[, x])

  • length — Length of the string in bytes. (U)Int*
  • x — Optional and ignored. The only purpose of the argument is to prevent common subexpression elimination when the same function call is used multiple times in a query. Any

Returns a string filled with random bytes. String

randomStringUTF8(length) staticmethod

randomStringUTF8(length)

  • length — Length of the string in code points. (U)Int*

Returns a string filled with random UTF-8 codepoints. String

range(start=None, end=None, step=None) staticmethod

range([start, ] end [, step])

  • start — Optional. The first element of the array. Required if step is used. Default value: 0. - end — Required. The number before which the array is constructed. - step — Optional. Determines the incremental step between each element in the array. Default value: 1. Array of numbers from start to end - 1 by step. Array(T)

rank(*args) staticmethod

rankCorr(x, y) staticmethod

rankCorr(x, y)

  • x — Arbitrary value. Float*
  • y — Arbitrary value. Float*

Returns a rank correlation coefficient of the ranks of x and y. The value ranges from -1 to +1. Float64

readWKB(wkb_string) staticmethod

readWKB(wkb_string)

  • wkb_string — The input WKB string representing a Point geometry. String

Returns a ClickHouse internal representation of the Geometry. Geo

readWKBLineString(wkb_string) staticmethod

readWKBLineString(wkb_string)

  • wkb_string — The input WKB string representing a LineString geometry. String

Returns returns a ClickHouse internal representation of the linestring geometry. Geo

readWKBMultiLineString(wkb_string) staticmethod

readWKBMultiLineString(wkb_string)

  • wkb_string — The input WKB string representing a MultiLineString geometry. String

Returns a ClickHouse internal representation of the multilinestring geometry. Geo

readWKBMultiPolygon(wkb_string) staticmethod

readWKBMultiPolygon(wkb_string)

  • wkb_string — The input WKB string representing a MultiPolygon geometry. String

Returns a ClickHouse internal representation of the MultiPolygon geometry. Geo

readWKBPoint(wkb_string) staticmethod

readWKBPoint(wkb_string)

  • wkb_string — The input WKB string representing a Point geometry. String

The function returns a ClickHouse internal representation of the point geometry. Geo

readWKBPolygon(wkb_string) staticmethod

readWKBPolygon(wkb_string)

  • wkb_string — The input WKB string representing a Polygon geometry. String

Returns a ClickHouse internal representation of the Polygon geometry. Geo

readWKT(wkt_string) staticmethod

readWKT(wkt_string)

  • wkt_string — The input WKT string representing a LineString geometry. String

Returns a ClickHouse internal representation of the Geometry.

readWKTLineString(wkt_string) staticmethod

readWKTLineString(wkt_string)

  • wkt_string — The input WKT string representing a LineString geometry. String

Returns a ClickHouse internal representation of the linestring geometry. Geo

readWKTMultiLineString(wkt_string) staticmethod

readWKTMultiLineString(wkt_string)

  • wkt_string — The input WKT string representing a MultiLineString geometry. String

Returns the function returns a ClickHouse internal representation of the multilinestring geometry. Geo

readWKTMultiPolygon(wkt_string) staticmethod

readWKTMultiPolygon(wkt_string)

  • wkt_string — String starting with MULTIPOLYGON String

Returns a MultiPolygon MultiPolygon

readWKTPoint(wkt_string) staticmethod

readWKTPoint(wkt_string)

  • wkt_string — The input WKT string representing a Point geometry. String

Returns a ClickHouse internal representation of the Point geometry. Geo

readWKTPolygon(wkt_string) staticmethod

readWKTPolygon(wkt_string)

  • wkt_string — String starting with POLYGON String

Returns a Polygon Polygon

readWKTRing(wkt_string) staticmethod

readWKTRing(wkt_string)

  • wkt_string — The input WKT string representing a Polygon geometry. String

Returns a ClickHouse internal representation of the ring (closed linestring) geometry. Geo

regexpExtract(haystack, pattern, index=None) staticmethod

regexpExtract(haystack, pattern[, index])

  • haystack — String, in which regexp pattern will be matched. String
  • pattern — String, regexp expression. pattern may contain multiple regexp groups, index indicates which regex group to extract. An index of 0 means matching the entire regular expression. const String
  • index — Optional. An integer number greater or equal 0 with default 1. It represents which regex group to extract. (U)Int*

Returns a string match String

regexpQuoteMeta(s) staticmethod

regexpQuoteMeta(s)

  • s — The input string containing characters to be escaped for regex. String

Returns a string with regex special characters escaped. String

regionHierarchy(id, geobase=None) staticmethod

regionHierarchy(id[, geobase])

  • id — Region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Array of region IDs consisting of the passed region and all parents along the chain Array(UInt32)

regionIn(lhs, rhs, geobase=None) staticmethod

regionIn(lhs, rhs[, geobase])

  • lhs — Lhs region ID from the geobase UInt32
  • rhs — Rhs region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Returns 1 if the region belongs, 0 otherwise UInt8

regionToArea(id, geobase=None) staticmethod

regionToArea(id[, geobase])

  • id — Region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Returns the region ID for the appropriate area, if it exists, otherwise returns 0 UInt32

regionToCity(id, geobase=None) staticmethod

regionToCity(id[, geobase])

  • id — Region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Returns the region ID for the appropriate city, if it exists, otherwise returns 0 UInt32

regionToContinent(id, geobase=None) staticmethod

regionToContinent(id[, geobase])

  • id — Region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Returns the region ID for the appropriate continent, if it exists, otherwise returns 0 UInt32

regionToCountry(id, geobase=None) staticmethod

regionToCountry(id[, geobase])

  • id — Region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Returns the region ID for the appropriate country, if it exists, otherwise returns 0 UInt32

regionToDistrict(id, geobase=None) staticmethod

regionToDistrict(id[, geobase])

  • id — Region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Returns the region ID for the appropriate district, if it exists, otherwise returns 0 UInt32

regionToName(id, lang=None) staticmethod

regionToName(id[, lang])

  • id — Region ID from the geobase UInt32
  • lang — Optional. Language code for the region name (e.g., 'en', 'ru'). Defaults to 'en'. String

Name of the region in the specified language, or an empty string if the region doesn't exist String

regionToPopulation(id, geobase=None) staticmethod

regionToPopulation(id[, geobase])

  • id — Region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Returns the population for the region, or 0 if there is none UInt32

regionToTopContinent(id, geobase=None) staticmethod

regionToTopContinent(id[, geobase])

  • id — Region ID from the geobase UInt32
  • geobase — Optional. The dictionary key. String

Returns the identifier of the top level continent (the latter when you climb the hierarchy of regions), or 0 if there is none UInt32

reinterpret(x, type) staticmethod

reinterpret(x, type)

  • x — Any type. Any
  • type — Destination type. If it is an array, then the array element type must be a fixed length type. String

Destination type value. Any

reinterpretAsDate(x) staticmethod

reinterpretAsDate(x)

Date. Date

reinterpretAsDateTime(x) staticmethod

reinterpretAsDateTime(x)

Date and Time. DateTime

reinterpretAsFixedString(x) staticmethod

reinterpretAsFixedString(x)

Fixed string containing bytes representing x. FixedString

reinterpretAsFloat32(x) staticmethod

reinterpretAsFloat32(x)

Returns the reinterpreted value x. Float32

reinterpretAsFloat64(x) staticmethod

reinterpretAsFloat64(x)

Returns the reinterpreted value x. Float64

reinterpretAsInt128(x) staticmethod

reinterpretAsInt128(x)

Returns the reinterpreted value x. Int128

reinterpretAsInt16(x) staticmethod

reinterpretAsInt16(x)

Returns the reinterpreted value x. Int16

reinterpretAsInt256(x) staticmethod

reinterpretAsInt256(x)

Returns the reinterpreted value x. Int256

reinterpretAsInt32(x) staticmethod

reinterpretAsInt32(x)

Returns the reinterpreted value x. Int32

reinterpretAsInt64(x) staticmethod

reinterpretAsInt64(x)

Returns the reinterpreted value x. Int64

reinterpretAsInt8(x) staticmethod

reinterpretAsInt8(x)

Returns the reinterpreted value x. Int8

reinterpretAsString(x) staticmethod

reinterpretAsString(x)

String containing bytes representing x. String

reinterpretAsUInt128(x) staticmethod

reinterpretAsUInt128(x)

Returns the reinterpreted value x. UInt128

reinterpretAsUInt16(x) staticmethod

reinterpretAsUInt16(x)

Returns the reinterpreted value x. UInt16

reinterpretAsUInt256(x) staticmethod

reinterpretAsUInt256(x)

Returns the reinterpreted value x. UInt256

reinterpretAsUInt32(x) staticmethod

reinterpretAsUInt32(x)

Returns the reinterpreted value x. UInt32

reinterpretAsUInt64(x) staticmethod

reinterpretAsUInt64(x)

Returns the reinterpreted value of x. UInt64

reinterpretAsUInt8(x) staticmethod

reinterpretAsUInt8(x)

Returns the reinterpreted value x. UInt8

reinterpretAsUUID(fixed_string) staticmethod

reinterpretAsUUID(fixed_string)

The UUID type value. UUID

removeDiacriticsUTF8(str) staticmethod

removeDiacriticsUTF8(str)

  • str — UTF-8 encoded input string. String

UTF-8 string with diacritics removed. String

repeat(s, n) staticmethod

repeat(s, n)

  • s — The string to repeat. String
  • n — The number of times to repeat the string. (U)Int*

A string containing string s repeated n times. If n is negative, the function returns the empty string. String

replaceAll(haystack, pattern, replacement) staticmethod

replaceAll(haystack, pattern, replacement)

  • haystack — The input string to search in. String
  • pattern — The substring to find and replace. const String
  • replacement — The string to replace the pattern with. const String

Returns a string with all occurrences of pattern replaced. String

replaceOne(haystack, pattern, replacement) staticmethod

replaceOne(haystack, pattern, replacement)

  • haystack — The input string to search in. String
  • pattern — The substring to find and replace. const String
  • replacement — The string to replace the pattern with. const String

Returns a string with the first occurrence of pattern replaced. String

replaceRegexpAll(haystack, pattern, replacement) staticmethod

replaceRegexpAll(haystack, pattern, replacement)

  • haystack — The input string to search in. String
  • pattern — The regular expression pattern to find. const String
  • replacement — The string to replace the pattern with, may contain substitutions. const String

Returns a string with all regex matches replaced. String

replaceRegexpOne(haystack, pattern, replacement) staticmethod

replaceRegexpOne(haystack, pattern, replacement)

  • haystack — The input string to search in. String
  • pattern — The regular expression pattern to find. const String
  • replacement — The string to replace the pattern with, may contain substitutions. const String

Returns a string with the first regex match replaced. String

replicate(x, arr) staticmethod

replicate(x, arr)

  • x — The value to fill the result array with. Any
  • arr — An array. Array(T)

Returns an array of the same length as arr filled with value x. Array(T)

retention(*args) staticmethod

reverse(arr, str) staticmethod

reverse(arr | str)

Returns an array or string with the order of elements or characters reversed.

reverseBySeparator(string, separator=None) staticmethod

reverseBySeparator(string[, separator])

  • string — The input string to reverse the order of its parts. String
  • separator — The separator string used to identify parts. If not provided, uses '.' (dot). Default: '.' String

Returns a string with substrings ordered from right to left of the original string, joined by the same separator. String

reverseUTF8(s) staticmethod

reverseUTF8(s)

  • s — String containing valid UTF-8 encoded text. String

Returns a string with the sequence of Unicode code points reversed. String

revision() staticmethod

revision()

Returns the current ClickHouse server revision. UInt32

right(s, offset) staticmethod

right(s, offset)

  • s — The string to calculate a substring from. String or FixedString
  • offset — The number of bytes of the offset. (U)Int*

Returns: - For positive offset, a substring of s with offset many bytes, starting from the right of the string. - For negative offset, a substring of s with length(s) - |offset| bytes, starting from the right of the string. - An empty string if length is 0. String

rightPad(string, length, pad_string=None) staticmethod

rightPad(string, length[, pad_string])

  • string — Input string that should be padded. String
  • length — The length of the resulting string. If the value is smaller than the input string length, then the input string is shortened to length characters. (U)Int*
  • pad_string — Optional. The string to pad the input string with. If not specified, then the input string is padded with spaces. String

Returns a right-padded string of the given length. String

rightPadUTF8(string, length, pad_string=None) staticmethod

rightPadUTF8(string, length[, pad_string])

  • string — Input string that should be padded. String
  • length — The length of the resulting string. If the value is smaller than the input string length, then the input string is shortened to length characters. (U)Int*
  • pad_string — Optional. The string to pad the input string with. If not specified, then the input string is padded with spaces. String

Returns a right-padded string of the given length. String

rightUTF8(s, offset) staticmethod

rightUTF8(s, offset)

  • s — The UTF-8 encoded string to calculate a substring from. String or FixedString
  • offset — The number of bytes of the offset. (U)Int*

Returns: - For positive offset, a substring of s with offset many bytes, starting from the right of the string. - For negative offset, a substring of s with length(s) - |offset| bytes, starting from the right of the string. - An empty string if length is 0. String

round(x, N=None) staticmethod

round(x[, N])

Returns a rounded number of the same type as x. Float* or Decimal* or (U)Int*

roundAge(num) staticmethod

roundAge(num)

  • age — A number representing an age in years. (U)Int* or Float*

Returns either the highest or lowest age of the range age falls within. UInt8

roundBankers(x, N=None) staticmethod

roundBankers(x[, N])

  • x — A number to round. (U)Int* or Decimal* or Float*
  • [, N] — Optional. The number of decimal places to round to. Defaults to 0. (U)Int*

Returns a value rounded by the banker's rounding method. (U)Int* or Decimal* or Float*

roundDown(num, arr) staticmethod

roundDown(num, arr)

Returns a number rounded down to an element in arr. If the value is less than the lowest bound, the lowest bound is returned. (U)Int* or Float*

roundDuration(num) staticmethod

roundDuration(num)

  • num — A number to round to one of the numbers in the set of common durations. (U)Int* or Float*

Returns 0, for num < 1. Otherwise, one of: 1, 10, 30, 60, 120, 180, 240, 300, 600, 1200, 1800, 3600, 7200, 18000, 36000. UInt16

roundToExp2(num) staticmethod

roundToExp2(num)

Returns num rounded down to the nearest (whole non-negative) power of two, otherwise 0 for num < 1. (U)Int* or Float*

rowNumberInAllBlocks() staticmethod

rowNumberInAllBlocks()

Returns the ordinal number of the row in the data block starting from 0. UInt64

rowNumberInBlock() staticmethod

rowNumberInBlock()

Returns the ordinal number of the row in the data block starting from 0. UInt64

row_number(*args) staticmethod

runningAccumulate(agg_state, grouping=None) staticmethod

runningAccumulate(agg_state[, grouping])

  • agg_state — State of the aggregate function. AggregateFunction
  • grouping — Optional. Grouping key. The state of the function is reset if the grouping value is changed. It can be any of the supported data types for which the equality operator is defined. Any

Returns the accumulated result for each row. Any

runningConcurrency(start, end) staticmethod

runningConcurrency(start, end)

Returns the number of concurrent events at each event start time. UInt32

runningDifference(x) staticmethod

runningDifference(x)

  • x — Column for which to calculate the running difference. Any

Returns the difference between consecutive values, with 0 for the first row.

runningDifferenceStartingWithFirstValue(x) staticmethod

runningDifferenceStartingWithFirstValue(x)

  • x — Column for which to calculate the running difference. Any

Returns the difference between consecutive values, with the first row's value for the first row. Any

s2CapContains(center, degrees, point) staticmethod

s2CapContains(center, degrees, point)

  • center — S2 cell identifier of the cap center point. UInt64
  • degrees — Radius of the cap in degrees. Float64
  • point — S2 cell identifier of the point to test. UInt64

Returns 1 if the cap contains the point and 0 otherwise. UInt8

s2CapUnion(center1, radius1, center2, radius2) staticmethod

s2CapUnion(center1, radius1, center2, radius2)

  • center1 — S2 cell identifier of the first cap center. UInt64
  • radius1 — Radius of the first cap in degrees. Float64
  • center2 — S2 cell identifier of the second cap center. UInt64
  • radius2 — Radius of the second cap in degrees. Float64

Returns a tuple (center, radius) representing the smallest cap containing both input caps. Tuple(UInt64, Float64)

s2CellsIntersect(s2index1, s2index2) staticmethod

s2CellsIntersect(s2index1, s2index2)

  • s2index1 — First S2 cell identifier. UInt64
  • s2index2 — Second S2 cell identifier. UInt64

Returns 1 if the cells intersect and 0 otherwise. UInt8

s2GetNeighbors(s2index) staticmethod

s2GetNeighbors(s2index)

  • s2index — The S2 cell identifier. UInt64

Returns an array of 4 neighbor S2 cell identifiers. Array(UInt64)

s2RectAdd(s2RectLow, s2RectHigh, s2Point) staticmethod

s2RectAdd(s2RectLow, s2RectHigh, s2Point)

  • s2RectLow — S2 cell identifier of the low vertex of the rectangle. UInt64
  • s2RectHigh — S2 cell identifier of the high vertex of the rectangle. UInt64
  • s2Point — S2 cell identifier of the point to add. UInt64

Returns a tuple (s2RectLow, s2RectHigh) representing the expanded rectangle. Tuple(UInt64, UInt64)

s2RectContains(s2RectLow, s2RectHigh, s2Point) staticmethod

s2RectContains(s2RectLow, s2RectHigh, s2Point)

  • s2RectLow — S2 cell identifier of the low vertex of the rectangle. UInt64
  • s2RectHigh — S2 cell identifier of the high vertex of the rectangle. UInt64
  • s2Point — S2 cell identifier of the point to test. UInt64

Returns 1 if the rectangle contains the point and 0 otherwise. UInt8

s2RectIntersection(s2Rect1Low, s2Rect1High, s2Rect2Low, s2Rect2High) staticmethod

s2RectIntersection(s2Rect1Low, s2Rect1High, s2Rect2Low, s2Rect2High)

  • s2Rect1Low — S2 cell identifier of the low vertex of the first rectangle. UInt64
  • s2Rect1High — S2 cell identifier of the high vertex of the first rectangle. UInt64
  • s2Rect2Low — S2 cell identifier of the low vertex of the second rectangle. UInt64
  • s2Rect2High — S2 cell identifier of the high vertex of the second rectangle. UInt64

Returns a tuple (s2RectLow, s2RectHigh) representing the intersection rectangle. Tuple(UInt64, UInt64)

s2RectUnion(s2Rect1Low, s2Rect1High, s2Rect2Low, s2Rect2High) staticmethod

s2RectUnion(s2Rect1Low, s2Rect1High, s2Rect2Low, s2Rect2High)

  • s2Rect1Low — S2 cell identifier of the low vertex of the first rectangle. UInt64
  • s2Rect1High — S2 cell identifier of the high vertex of the first rectangle. UInt64
  • s2Rect2Low — S2 cell identifier of the low vertex of the second rectangle. UInt64
  • s2Rect2High — S2 cell identifier of the high vertex of the second rectangle. UInt64

Returns a tuple (s2RectLow, s2RectHigh) representing the union rectangle. Tuple(UInt64, UInt64)

s2ToGeo(s2index) staticmethod

s2ToGeo(s2index)

  • s2index — The S2 cell identifier. UInt64

Returns a tuple (lon, lat) of Float64 values representing the longitude and latitude. Tuple(Float64, Float64)

sequenceCount(*args) staticmethod

sequenceMatch(*args) staticmethod

sequenceMatchEvents(*args) staticmethod

sequenceNextNode(*args) staticmethod

seriesDecomposeSTL(series, period) staticmethod

seriesDecomposeSTL(series, period)

Returns an array of four arrays where the first array includes seasonal components, the second array - trend, the third array - residue component, and the fourth array - baseline(seasonal + trend) component. Array(Array(Float32), Array(Float32), Array(Float32), Array(Float32))

seriesOutliersDetectTukey(series, min_percentile=None, max_percentile=None, K=None) staticmethod

seriesOutliersDetectTukey(series[, min_percentile, max_percentile, K])

  • series — An array of numeric values. Array((UInt8/16/32/64)) or Array(Float*)
  • min_percentile — Optional. The minimum percentile to be used to calculate inter-quantile range (IQR). The value must be in range [0.02,0.98]. The default is 0.25. Float*
  • max_percentile — Optional. The maximum percentile to be used to calculate inter-quantile range (IQR). The value must be in range [0.02,0.98]. The default is 0.75. Float*
  • K — Optional. Non-negative constant value to detect mild or stronger outliers. The default value is 1.5. Float*

Returns an array of the same length as the input array where each value represents score of possible anomaly of corresponding element in the series. A non-zero score indicates a possible anomaly. Array(Float32)

seriesPeriodDetectFFT(series) staticmethod

seriesPeriodDetectFFT(series)

Returns a real value equal to the period of series data. NaN when number of data points are less than four. Float64

serverTimezone() staticmethod

serverTimezone()

Returns the server timezone as a String

serverUUID() staticmethod

serverUUID()

Returns the random UUID of the server. UUID

shardCount() staticmethod

shardCount()

Returns the total number of shards or 0. UInt32

shardNum() staticmethod

shardNum()

Returns the shard index or a constant 0. UInt32

showCertificate() staticmethod

showCertificate()

Returns map of key-value pairs relating to the configured SSL certificate. Map(String, String)

sigmoid(x) staticmethod

sigmoid(x)

Returns the sigmoid of the input value, in the range (0, 1). Float64

sign(x) staticmethod

sign(x)

Returns -1 for x < 0, 0 for x = 0, 1 for x > 0. Int8

simpleJSONExtractBool(json, field_name) staticmethod

simpleJSONExtractBool(json, field_name)

  • json — The JSON in which the field is searched for. String
  • field_name — The name of the field to search for. const String

Returns 1 if the value of the field is true, 0 otherwise. This means this function will return 0 including (and not only) in the following cases: - If the field doesn't exists. - If the field contains true as a string, e.g.: {"field":"true"}. - If the field contains 1 as a numerical value. UInt8

simpleJSONExtractFloat(json, field_name) staticmethod

simpleJSONExtractFloat(json, field_name)

  • json — The JSON in which the field is searched for. String
  • field_name — The name of the field to search for. const String

Returns the number parsed from the field if the field exists and contains a number, otherwise 0. Float64

simpleJSONExtractInt(json, field_name) staticmethod

simpleJSONExtractInt(json, field_name)

  • json — The JSON in which the field is searched for. String
  • field_name — The name of the field to search for. const String

Returns the number parsed from the field if the field exists and contains a number, 0 otherwise Int64

simpleJSONExtractRaw(json, field_name) staticmethod

simpleJSONExtractRaw(json, field_name)

  • json — The JSON in which the field is searched for. String
  • field_name — The name of the field to search for. const String

Returns the value of the field as a string, including separators if the field exists, or an empty string otherwise String

simpleJSONExtractString(json, field_name) staticmethod

simpleJSONExtractString(json, field_name)

  • json — The JSON in which the field is searched for. String
  • field_name — The name of the field to search for. const String

Returns the unescaped value of a field as a string, including separators. An empty string is returned if the field doesn't contain a double quoted string, if unescaping fails or if the field doesn't exist String

simpleJSONExtractUInt(json, field_name) staticmethod

simpleJSONExtractUInt(json, field_name)

  • json — The JSON in which the field is searched for. String
  • field_name — The name of the field to search for. const String

Returns the number parsed from the field if the field exists and contains a number, 0 otherwise UInt64

simpleJSONHas(json, field_name) staticmethod

simpleJSONHas(json, field_name)

  • json — The JSON in which the field is searched for. String
  • field_name — The name of the field to search for. const String

Returns 1 if the field exists, 0 otherwise UInt8

simpleLinearRegression(x, y) staticmethod

simpleLinearRegression(x, y)

  • x — Column with explanatory variable values. Float64
  • y — Column with dependent variable values. Float64

Returns constants (k, b) of the resulting line y = k*x + b. Tuple(Float64, Float64)

sin(x) staticmethod

sin(x)

Returns the sine of x.

singleValueOrNull(x) staticmethod

singleValueOrNull(x)

  • x — A column of any data type except Map, Array or Tuple which cannot be of type Nullable. Any

Returns the unique value if there is only one unique non-NULL value in x. Returns NULL if there are zero or at least two distinct values. Any or NULL

sinh(x) staticmethod

sinh(x)

Returns values from the interval: -∞ < sinh(x) < +∞ Float64

sipHash128(arg1, arg2=None) staticmethod

sipHash128(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns a 128-bit SipHash hash value. FixedString(16)

sipHash128Keyed(k0, k1) staticmethod

sipHash128Keyed((k0, k1), [arg1, arg2, ...])

  • (k0, k1) — A tuple of two UInt64 values representing the key. Tuple(UInt64, UInt64)
  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

A 128-bit SipHash hash value of type FixedString(16). FixedString(16)

sipHash128Reference(arg1, arg2=None) staticmethod

sipHash128Reference(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed 128-bit SipHash hash value of the input arguments. FixedString(16)

sipHash128ReferenceKeyed(k0, k1) staticmethod

sipHash128ReferenceKeyed((k0, k1), arg1[, arg2, ...])

  • (k0, k1) — Tuple of two values representing the key Tuple(UInt64, UInt64)
  • arg1[, arg2, ...] — A variable number of input arguments for which to compute the hash. Any

Returns the computed 128-bit SipHash hash value of the input arguments. FixedString(16)

sipHash64(arg1, arg2=None) staticmethod

sipHash64(arg1[, arg2, ...])

  • arg1[, arg2, ...] — A variable number of input arguments. Any

Returns a computed hash value of the input arguments. UInt64

sipHash64Keyed(k0, k1) staticmethod

sipHash64Keyed((k0, k1), arg1[,arg2, ...])

  • (k0, k1) — A tuple of two values representing the key. Tuple(UInt64, UInt64)
  • arg1[,arg2, ...] — A variable number of input arguments. Any

Returns the computed hash of the input values. UInt64

skewPop(expr) staticmethod

skewPop(expr)

  • expr — An expression returning a number. Expression

Returns the skewness of the given distribution. Float64

skewSamp(expr) staticmethod

skewSamp(expr)

  • expr — An expression returning a number. Expression

Returns the skewness of the given distribution. If n <= 1 (n is the size of the sample), then the function returns nan. Float64

sleep(seconds) staticmethod

sleep(seconds)

  • seconds — The number of seconds to pause the query execution to a maximum of 3 seconds. It can be a floating-point value to specify fractional seconds. const UInt* or const Float*

Returns 0. UInt8

sleepEachRow(seconds) staticmethod

sleepEachRow(seconds)

  • seconds — The number of seconds to pause the query execution for each row in the result set to a maximum of 3 seconds. It can be a floating-point value to specify fractional seconds. const UInt* or const Float*

Returns 0 for each row. UInt8

snowflakeIDToDateTime(value, epoch=None, time_zone=None) staticmethod

snowflakeIDToDateTime(value[, epoch[, time_zone]])

  • value — Snowflake ID. UInt64
  • epoch — Optional. Epoch of the Snowflake ID in milliseconds since 1970-01-01. Defaults to 0 (1970-01-01). For the Twitter/X epoch (2015-01-01), provide 1288834974657. UInt*
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns the timestamp component of value. DateTime

snowflakeIDToDateTime64(value, epoch=None, time_zone=None) staticmethod

snowflakeIDToDateTime64(value[, epoch[, time_zone]])

  • value — Snowflake ID. UInt64
  • epoch — Optional. Epoch of the Snowflake ID in milliseconds since 1970-01-01. Defaults to 0 (1970-01-01). For the Twitter/X epoch (2015-01-01), provide 1288834974657. UInt*
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns the timestamp component of value as a DateTime64 with scale = 3, i.e. millisecond precision. DateTime64

snowflakeToDateTime(value, time_zone=None) staticmethod

snowflakeToDateTime(value[, time_zone])

  • value — Snowflake ID. Int64
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns the timestamp component of value. DateTime

snowflakeToDateTime64(value, time_zone=None) staticmethod

snowflakeToDateTime64(value[, time_zone])

  • value — Snowflake ID. Int64
  • time_zone — Optional. Timezone. The function parses time_string according to the timezone. String

Returns the timestamp component of value. DateTime64(3)

soundex(s) staticmethod

soundex(s)

Returns the Soundex code of the input string. String

space(n) staticmethod

space(n)

  • n — The number of times to repeat the space. (U)Int*

Returns astring containing a space repeated n times. If n <= 0, the function returns the empty string. String

sparkbar(buckets, min_x=None, max_x=None) staticmethod

sparkbar(buckets[, min_x, max_x])(x, y)

Returns the frequency histogram. String

sparseGrams(s, min_ngram_length=None, max_ngram_length=None) staticmethod

sparseGrams(s[, min_ngram_length, max_ngram_length])

  • s — An input string. String
  • min_ngram_length — Optional. The minimum length of extracted ngram. The default and minimal value is 3. UInt*
  • max_ngram_length — Optional. The maximum length of extracted ngram. The default value is 100. Should be not less than min_ngram_length. UInt*
  • min_cutoff_length — Optional. If specified, only n-grams with length greater or equal than min_cutoff_length are returned. The default value is the same as min_ngram_length. Should be not less than min_ngram_length and not greater than max_ngram_length. UInt*

Returns an array of selected substrings. Array(String)

sparseGramsHashes(s, min_ngram_length=None, max_ngram_length=None) staticmethod

sparseGramsHashes(s[, min_ngram_length, max_ngram_length])

  • s — An input string. String
  • min_ngram_length — Optional. The minimum length of extracted ngram. The default and minimal value is 3. UInt*
  • max_ngram_length — Optional. The maximum length of extracted ngram. The default value is 100. Should be not less than min_ngram_length. UInt*
  • min_cutoff_length — Optional. If specified, only n-grams with length greater or equal than min_cutoff_length are returned. The default value is the same as min_ngram_length. Should be not less than min_ngram_length and not greater than max_ngram_length. UInt*

Returns an array of selected substrings CRC32 hashes. Array(UInt32)

sparseGramsHashesUTF8(s, min_ngram_length=None, max_ngram_length=None) staticmethod

sparseGramsHashesUTF8(s[, min_ngram_length, max_ngram_length])

  • s — An input string. String
  • min_ngram_length — Optional. The minimum length of extracted ngram. The default and minimal value is 3. UInt*
  • max_ngram_length — Optional. The maximum length of extracted ngram. The default value is 100. Should be not less than min_ngram_length. UInt*
  • min_cutoff_length — Optional. If specified, only n-grams with length greater or equal than min_cutoff_length are returned. The default value is the same as min_ngram_length. Should be not less than min_ngram_length and not greater than max_ngram_length. UInt*

Returns an array of selected UTF-8 substrings CRC32 hashes. Array(UInt32)

sparseGramsUTF8(s, min_ngram_length=None, max_ngram_length=None) staticmethod

sparseGramsUTF8(s[, min_ngram_length, max_ngram_length])

  • s — An input string. String
  • min_ngram_length — Optional. The minimum length of extracted ngram. The default and minimal value is 3. UInt*
  • max_ngram_length — Optional. The maximum length of extracted ngram. The default value is 100. Should be not less than min_ngram_length. UInt*
  • min_cutoff_length — Optional. If specified, only n-grams with length greater or equal than min_cutoff_length are returned. The default value is the same as min_ngram_length. Should be not less than min_ngram_length and not greater than max_ngram_length. UInt*

Returns an array of selected UTF-8 substrings. Array(String)

splitByChar(separator, s, max_substrings=None) staticmethod

splitByChar(separator, s[, max_substrings])

  • separator — The separator must be a single-byte character. String
  • s — The string to split. String
  • max_substrings — Optional. If max_substrings > 0, the returned array will contain at most max_substrings substrings, otherwise the function will return as many substrings as possible. The default value is 0. Int64

Returns an array of selected substrings. Array(String)

splitByNonAlpha(s, max_substrings=None) staticmethod

splitByNonAlpha(s[, max_substrings])

  • s — The string to split. String
  • max_substrings — Optional. When max_substrings > 0, the returned substrings will be no more than max_substrings, otherwise the function will return as many substrings as possible. Default value: 0. Int64

Returns an array of selected substrings of s. Array(String)

splitByRegexp(regexp, s, max_substrings=None) staticmethod

splitByRegexp(regexp, s[, max_substrings])

  • regexp — Regular expression. Constant. String or FixedString
  • s — The string to split. String
  • max_substrings — Optional. When max_substrings > 0, the returned substrings will be no more than max_substrings, otherwise the function will return as many substrings as possible. Default value: 0. Int64

Returns an array of the selected substrings of s. Array(String)

splitByString(separator, s, max_substrings=None) staticmethod

splitByString(separator, s[, max_substrings])

  • separator — The separator. String
  • s — The string to split. String
  • max_substrings — Optional. When max_substrings > 0, the returned substrings will be no more than max_substrings, otherwise the function will return as many substrings as possible. Default value: 0. Int64

Returns an array of selected substrings of s Array(String)

splitByWhitespace(s, max_substrings=None) staticmethod

splitByWhitespace(s[, max_substrings])

  • s — The string to split. String
  • max_substrings — Optional. When max_substrings > 0, the returned substrings will be no more than max_substrings, otherwise the function will return as many substrings as possible. Default value: 0. Int64

Returns an array of the selected substrings of s. Array(String)

sqidDecode(sqid) staticmethod

sqidDecode(sqid)

  • sqid — The sqid to decode. String

Returns an array of numbers from sqid. Array(UInt64)

sqidEncode(n1, n2=None) staticmethod

sqidEncode(n1[, n2, ...])

Returns a hash ID String

sqrt(x) staticmethod

sqrt(x)

Returns the square root of x Float*

startsWith(s, prefix) staticmethod

startsWith(s, prefix)

  • s — String to check. String
  • prefix — Prefix to check for. String

Returns 1 if s starts with prefix, otherwise 0. UInt8

startsWithCaseInsensitive(s, prefix) staticmethod

startsWithCaseInsensitive(s, prefix)

  • s — String to check. String
  • prefix — Case-insensitive prefix to check for. String

Returns 1 if s starts with case-insensitive prefix, otherwise 0. UInt8

startsWithCaseInsensitiveUTF8(s, prefix) staticmethod

startsWithCaseInsensitiveUTF8(s, prefix)

  • s — String to check. String
  • prefix — Case-insensitive prefix to check for. String

Returns 1 if s starts with case-insensitive prefix, otherwise 0. UInt8

startsWithUTF8(s, prefix) staticmethod

startsWithUTF8(s, prefix)

  • s — String to check. String
  • prefix — Prefix to check for. String

Returns 1 if s starts with prefix, otherwise 0. UInt8

stddevPop(x) staticmethod

stddevPop(x)

Returns the square root of population variance of x. Float64

stddevPopStable(x) staticmethod

stddevPopStable(x)

Returns the square root of the variance of x. Float64

stddevSamp(x) staticmethod

stddevSamp(x)

Returns the square root of sample variance of x. Float64

stddevSampStable(x) staticmethod

stddevSampStable(x)

Returns the square root of sample variance of x. Float64

stem(lang, word) staticmethod

stem(lang, word)

  • lang — Language which rules will be applied. Use the two letter ISO 639-1 code. String
  • word — Lowercase word that needs to be stemmed. String

Returns the stemmed form of the word String

stochasticLinearRegression(learning_rate=None, l2_regularization_coef=None, mini_batch_size=None, method=None) staticmethod

stochasticLinearRegression([learning_rate, l2_regularization_coef, mini_batch_size, method])(target, x1, x2, ...)

  • learning_rate — The coefficient on step length when gradient descent step is performed. A learning rate that is too big may cause infinite weights of the model. Default is 0.00001. Float64
  • l2_regularization_coef — L2 regularization coefficient which may help to prevent overfitting. Default is 0.1. Float64
  • mini_batch_size — Sets the number of elements which gradients will be computed and summed to perform one step of gradient descent. Pure stochastic descent uses one element, however having small batches (about 10 elements) makes gradient steps more stable. Default is 15. UInt64
  • method — Method for updating weights: Adam (by default), SGD, Momentum, Nesterov. Momentum and Nesterov require slightly more computations and memory, however they happen to be useful in terms of speed of convergence and stability of stochastic gradient methods. const String
  • target — Target value (dependent variable) to learn to predict. Must be numeric. Float*
  • x1, x2, ... — Feature values (independent variables). All must be numeric. Float*

Returns the trained linear regression model weights. First values correspond to the parameters of the model, the last one is bias. Use evalMLMethod for predictions. Array(Float64)

stochasticLogisticRegression(learning_rate=None, l2_regularization_coef=None, mini_batch_size=None, method=None) staticmethod

stochasticLogisticRegression([learning_rate, l2_regularization_coef, mini_batch_size, method])(target, x1, x2, ...)

  • learning_rate — The coefficient on step length when gradient descent step is performed. A learning rate that is too big may cause infinite weights of the model. Default is 0.00001. Float64
  • l2_regularization_coef — L2 regularization coefficient which may help to prevent overfitting. Default is 0.1. Float64
  • mini_batch_size — Sets the number of elements which gradients will be computed and summed to perform one step of gradient descent. Pure stochastic descent uses one element, however having small batches (about 10 elements) makes gradient steps more stable. Default is 15. UInt64
  • method — Method for updating weights: Adam (by default), SGD, Momentum, Nesterov. Momentum and Nesterov require a little bit more computations and memory, however they happen to be useful in terms of speed of convergence and stability of stochastic gradient methods. String
  • target — Target binary classification labels. Must be in range [-1, 1]. Float
  • x1, x2, ... — Feature values (independent variables). All must be numeric. Float

Returns the trained logistic regression model weights. Use evalMLMethod for predictions which returns probabilities of object having label 1. Array(Float64)

stringBytesEntropy(s) staticmethod

stringBytesEntropy(s)

  • s — The string to analyze. String

Returns Shannon's entropy of byte distribution in the string. Float64

stringBytesUniq(s) staticmethod

stringBytesUniq(s)

  • s — The string to analyze. String

Returns the number of distinct bytes in the string. UInt16

stringJaccardIndex(s1, s2) staticmethod

stringJaccardIndex(s1, s2)

  • s1 — First input string. String
  • s2 — Second input string. String

Returns the Jaccard similarity index between the two strings. Float64

stringJaccardIndexUTF8(s1, s2) staticmethod

stringJaccardIndexUTF8(s1, s2)

  • s1 — First input UTF8 string. String
  • s2 — Second input UTF8 string. String

Returns the Jaccard similarity index between the two UTF8 strings. Float64

stringToH3(index_str) staticmethod

stringToH3(index_str)

  • index_str — String representation of the H3 index. String

Returns the H3 index number, or 0 if the input is not a valid H3 index. UInt64

structureToCapnProtoSchema(table_structure, message) staticmethod

structureToCapnProtoSchema(table_structure, message)

structureToProtobufSchema(structure, message_name) staticmethod

structureToProtobufSchema(structure, message_name)

  • structure — ClickHouse table structure definition as a string (e.g., 'column1 Type1, column2 Type2'). String
  • message_name — Name for the Protobuf message type in the generated schema. String

Returns a Protobuf schema definition in proto3 syntax that corresponds to the input ClickHouse structure. String

studentTTest(confidence_level=None) staticmethod

studentTTest([confidence_level])(sample_data, sample_index)

Returns a tuple with two or four elements (if the optional confidence_level is specified): calculated t-statistic, calculated p-value, [calculated confidence-interval-low], [calculated confidence-interval-high]. Tuple(Float64, Float64) or Tuple(Float64, Float64, Float64, Float64)

studentTTestOneSample(confidence_level=None) staticmethod

studentTTestOneSample([confidence_level])(sample_data, population_mean)

Returns a tuple with two or four elements (if confidence_level is specified): calculated t-statistic, calculated p-value (two-tailed), [calculated confidence-interval-low], [calculated confidence-interval-high]. Confidence intervals are for the sample mean at the given confidence level. Tuple(Float64, Float64) or Tuple(Float64, Float64, Float64, Float64)

subBitmap(bitmap, offset, cardinality_limit) staticmethod

subBitmap(bitmap, offset, cardinality_limit)

subDate(datetime, interval) staticmethod

subDate(datetime, interval)

Returns date or date with time obtained by subtracting interval from datetime. Date or Date32 or DateTime or DateTime64

substring(s, offset, length=None) staticmethod

substring(s, offset[, length])

  • s — The string to calculate a substring from. String or FixedString or Enum
  • offset — The starting position of the substring in s. (U)Int*
  • length — Optional. The maximum length of the substring. (U)Int*

Returns a substring of s with length many bytes, starting at index offset. String

substringIndex(s, delim, count) staticmethod

substringIndex(s, delim, count)

  • s — The string to extract substring from. String
  • delim — The character to split. String
  • count — The number of occurrences of the delimiter to count before extracting the substring. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (counting from the right) is returned. UInt or Int

Returns a substring of s before count occurrences of delim. String

substringIndexUTF8(s, delim, count) staticmethod

substringIndexUTF8(s, delim, count)

  • s — The string to extract substring from. String
  • delim — The character to split. String
  • count — The number of occurrences of the delimiter to count before extracting the substring. If count is positive, everything to the left of the final delimiter (counting from the left) is returned. If count is negative, everything to the right of the final delimiter (counting from the right) is returned. UInt or Int

Returns a substring of s before count occurrences of delim. String

substringUTF8(s, offset, length=None) staticmethod

substringUTF8(s, offset[, length])

  • s — The string to calculate a substring from. String or FixedString or Enum
  • offset — The starting position of the substring in s. Int or UInt
  • length — The maximum length of the substring. Optional. Int or UInt

Returns a substring of s with length many code points, starting at code point index offset. String

subtractDays(datetime, num) staticmethod

subtractDays(datetime, num)

Returns datetime minus num days Date or Date32 or DateTime or DateTime64

subtractHours(datetime, num) staticmethod

subtractHours(datetime, num)

Returns datetime minus num hours DateTime or DateTime64(3)

subtractInterval(interval_1, interval_2) staticmethod

subtractInterval(interval_1, interval_2)

Returns a tuple of intervals Tuple(T)

subtractMicroseconds(datetime, num) staticmethod

subtractMicroseconds(datetime, num)

Returns datetime minus num microseconds DateTime64

subtractMilliseconds(datetime, num) staticmethod

subtractMilliseconds(datetime, num)

Returns datetime minus num milliseconds DateTime64

subtractMinutes(datetime, num) staticmethod

subtractMinutes(datetime, num)

Returns datetime minus num minutes DateTime or DateTime64(3)

subtractMonths(datetime, num) staticmethod

subtractMonths(datetime, num)

Returns datetime minus num months Date or Date32 or DateTime or DateTime64

subtractNanoseconds(datetime, num) staticmethod

subtractNanoseconds(datetime, num)

Returns datetime minus num nanoseconds DateTime64

subtractQuarters(datetime, num) staticmethod

subtractQuarters(datetime, num)

Returns datetime minus num quarters Date or Date32 or DateTime or DateTime64

subtractSeconds(datetime, num) staticmethod

subtractSeconds(datetime, num)

Returns datetime minus num seconds DateTime or DateTime64(3)

subtractTupleOfIntervals(datetime, intervals) staticmethod

subtractTupleOfIntervals(datetime, intervals)

Returns date with subtracted intervals Date or Date32 or DateTime or DateTime64

subtractWeeks(datetime, num) staticmethod

subtractWeeks(datetime, num)

Returns datetime minus num weeks Date or Date32 or DateTime or DateTime64

subtractYears(datetime, num) staticmethod

subtractYears(datetime, num)

Returns datetime minus num years Date or Date32 or DateTime or DateTime64

sum(num) staticmethod

sum(num)

Returns the sum of the values. (U)Int* or Float* or Decimal*

sumCount(x) staticmethod

sumCount(x)

Returns a tuple (sum, count), where sum is the sum of numbers and count is the number of rows with not-NULL values. Tuple

sumKahan(x) staticmethod

sumKahan(x)

Returns the sum of numbers. (U)Int* or Float* or Decimal

sumMapFiltered(*args) staticmethod

sumMapFilteredWithOverflow(*args) staticmethod

sumMapWithOverflow(key, value) staticmethod

sumMapWithOverflow(key, value) sumMapWithOverflow(Tuple(key, value))

  • key — Array of keys. Array
  • value — Array of values. Array

Returns a tuple of two arrays: keys in sorted order, and values summed for the corresponding keys. Tuple(Array, Array)

sumMappedArrays(key, value1, value2=None) staticmethod

sumMappedArrays(key, value1 [, value2, ...]) sumMappedArrays(Tuple(key, value1 [, value2, ...]))

  • key — Array of keys. Array
  • value1, value2, ... — Arrays of values to sum for each key. Array

Returns a tuple of arrays: the first array contains keys in sorted order, followed by arrays containing values summed for the corresponding keys. Tuple

sumWithOverflow(num) staticmethod

sumWithOverflow(num)

The sum of the values. (U)Int* or Float* or Decimal*

svg(geometry, style=None) staticmethod

svg(geometry[, style])

  • geometry — Geometry object (Point, Ring, Polygon, MultiPolygon). Point or Ring or Polygon or MultiPolygon
  • style — Optional CSS style string to apply to the SVG element. String

Returns the SVG representation of the geometry. String

synonyms(ext_name, word) staticmethod

synonyms(ext_name, word)

  • ext_name — Name of the extension in which search will be performed. String
  • word — Word that will be searched in extension. String

Returns array of synonyms for the given word. Array(String)

tan(x) staticmethod

tan(x)

Returns the tangent of x. Float*

tanh(x) staticmethod

tanh(x)

Returns values from the interval: -1 < tanh(x) < 1 Float*

tcpPort() staticmethod

tcpPort()

Returns the TCP port number. UInt16

tgamma(x) staticmethod

tgamma(x)

Returns the gamma function value Float*

theilsU(column1, column2) staticmethod

theilsU(column1, column2)

  • column1 — First column to be compared. Any
  • column2 — Second column to be compared. Any

Returns a value between -1 and 1. Float64

throwIf(x, message=None, error_code=None) staticmethod

throwIf(x[, message[, error_code]])

Returns 0 if the condition is false, throws an exception if the condition is true. UInt8

tid() staticmethod

tid()

Returns the current thread id. UInt64

timeDiff(startdate, enddate) staticmethod

timeDiff(startdate, enddate)

Returns the difference between enddate and startdate expressed in seconds. Int64

timeSeriesChangesToGrid(start_timestamp, end_timestamp, grid_step, staleness) staticmethod

timeSeriesChangesToGrid(start_timestamp, end_timestamp, grid_step, staleness)(timestamp, value)

  • timestamp — Timestamp of the sample. Can be individual values or arrays. - value — Value of the time series corresponding to the timestamp. Can be individual values or arrays. changes values on the specified grid as an Array(Nullable(Float64)). The returned array contains one value for each time grid point. The value is NULL if there are no samples within the window to calculate the changes value for a particular grid point.

timeSeriesCopyTag(dest_group, src_group, tag_to_copy) staticmethod

timeSeriesCopyTag(dest_group, src_group, tag_to_copy)

  • dest_group — The destination group of tags. UInt64
  • src_group — The source group of tags. UInt64
  • tag_to_copy — The name of a tag to copy. String

Returns a group of tags containing the tags from dest_group along with the copied tags from src_group. UInt64

timeSeriesCopyTags(dest_group, src_group, tags_to_copy) staticmethod

timeSeriesCopyTags(dest_group, src_group, tags_to_copy)

  • dest_group — The destination group of tags. UInt64
  • src_group — The source group of tags. UInt64
  • tags_to_copy — The names of tags to copy. Array(String)

Returns a group of tags containing the tags from dest_group along with the copied tags from src_group. UInt64

timeSeriesDeltaToGrid(start_timestamp, end_timestamp, grid_step, staleness) staticmethod

timeSeriesDeltaToGrid(start_timestamp, end_timestamp, grid_step, staleness)(timestamp, value)

Returns delta values on the specified grid. The returned array contains one value for each time grid point. The value is NULL if there are not enough samples within the window to calculate the delta value for a particular grid point. Array(Nullable(Float64))

timeSeriesDerivToGrid(start_timestamp, end_timestamp, grid_step, staleness) staticmethod

timeSeriesDerivToGrid(start_timestamp, end_timestamp, grid_step, staleness)(timestamp, value)

  • timestamp — Timestamp of the sample. Can be individual values or arrays. - value — Value of the time series corresponding to the timestamp. Can be individual values or arrays. deriv values on the specified grid as an Array(Nullable(Float64)). The returned array contains one value for each time grid point. The value is NULL if there are not enough samples within the window to calculate the derivative value for a particular grid point.

timeSeriesExtractTag(group) staticmethod

timeSeriesExtractTag(group)

  • group — A group of tags. UInt64
  • tag_to_extract — The name of a tag to extract from the group String

Returns the value of a specified tag. Nullable(String)

timeSeriesFromGrid(start_timestamp, end_timestamp, step, values) staticmethod

timeSeriesFromGrid(start_timestamp, end_timestamp, step, values)

Returns values from the source array of values combined with timestamps on a regular time grid described by start_timestamp and step. Array(Tuple(DateTime64, Float64))

timeSeriesGroupArray(timestamp, value) staticmethod

timeSeriesGroupArray(timestamp, value)

Returns an array of tuples (timestamp, value) sorted by timestamp in ascending order. If there are multiple values for the same timestamp then the function chooses the greatest of these values. Array(Tuple(T1, T2))

timeSeriesGroupToTags(group) staticmethod

timeSeriesGroupToTags(group)

  • group — A group of tags. UInt64

Returns an array of pairs (tag_name, tag_value). The returned array is always sorted by tag_name and never contains the same tag_name more than once. Array(Tuple(String, String))

timeSeriesIdToGroup(id) staticmethod

timeSeriesIdToGroup(id)

Returns a group of tags associated with the identifier id of a time series. UInt64

timeSeriesIdToTags(id) staticmethod

timeSeriesIdToTags(id)

Returns an array of pairs (tag_name, tag_value). The returned array is always sorted by tag_name and never contains the same tag_name more than once. Array(Tuple(String, String))

timeSeriesInstantDeltaToGrid(start_timestamp, end_timestamp, grid_step, staleness) staticmethod

timeSeriesInstantDeltaToGrid(start_timestamp, end_timestamp, grid_step, staleness)(timestamp, value)

Returns idelta values on the specified grid. The returned array contains one value for each time grid point. The value is NULL if there are not enough samples within the window to calculate the instant delta value for a particular grid point. Array(Nullable(Float64))

timeSeriesInstantRateToGrid(start_timestamp, end_timestamp, grid_step, staleness) staticmethod

timeSeriesInstantRateToGrid(start_timestamp, end_timestamp, grid_step, staleness)(timestamp, value)

Returns irate values on the specified grid. The returned array contains one value for each time grid point. The value is NULL if there are not enough samples within the window to calculate the instant rate value for a particular grid point. Array(Nullable(Float64))

timeSeriesJoinTags(group, dest_tag, separator, src_tags) staticmethod

timeSeriesJoinTags(group, dest_tag, separator, src_tags)

  • group — A group of tags. UInt64
  • dest_tag — The name of a tag with the joined result which will be added to the group. String
  • separator — A separator to insert between joined values. String
  • src_tags — The names of source tags with values which will be joined. Array(String)

Returns a new group of tags with the dest_tag tag set to the joined result. UInt64

timeSeriesLastTwoSamples(timestamp, value) staticmethod

timeSeriesLastTwoSamples(timestamp, value)

Returns a pair of arrays of equal length from 0 to 2. The first array contains the timestamps of sampled time series, the second array contains the corresponding values of the time series. Tuple(Array(DateTime), Array(Float64))

timeSeriesPredictLinearToGrid(start_timestamp, end_timestamp, grid_step, staleness, predict_offset) staticmethod

timeSeriesPredictLinearToGrid(start_timestamp, end_timestamp, grid_step, staleness, predict_offset)(timestamp, value)

  • timestamp — Timestamp of the sample. Can be individual values or arrays. - value — Value of the time series corresponding to the timestamp. Can be individual values or arrays. predict_linear values on the specified grid as an Array(Nullable(Float64)). The returned array contains one value for each time grid point. The value is NULL if there are not enough samples within the window to calculate the rate value for a particular grid point.

timeSeriesRange(start_timestamp, end_timestamp, step) staticmethod

timeSeriesRange(start_timestamp, end_timestamp, step)

Returns a range of timestamps. Array(DateTime64)

timeSeriesRateToGrid(start_timestamp, end_timestamp, grid_step, staleness) staticmethod

timeSeriesRateToGrid(start_timestamp, end_timestamp, grid_step, staleness)(timestamp, value)

Returns rate values on the specified grid. The returned array contains one value for each time grid point. The value is NULL if there are not enough samples within the window to calculate the rate value for a particular grid point. Array(Nullable(Float64))

timeSeriesRemoveAllTagsExcept(group, tags_to_keep) staticmethod

timeSeriesRemoveAllTagsExcept(group, tags_to_keep)

  • group — A group of tags. UInt64
  • tags_to_keep — The names of tags to keep in the group. Array(String)

A new group of tags with only the specified tags kept. UInt64

timeSeriesRemoveTag(group, tag_to_remove) staticmethod

timeSeriesRemoveTag(group, tag_to_remove)

  • group — A group of tags. UInt64
  • tag_to_remove — The name of a tag to remove from the group. String

A new group of tags without the specified tag. UInt64

timeSeriesRemoveTags(group, tags_to_remove) staticmethod

timeSeriesRemoveTags(group, tags_to_remove)

  • group — A group of tags. UInt64
  • tags_to_remove — The names of tags to remove from the group. Array(String)

A new group of tags without the specified tags. UInt64

timeSeriesReplaceTag(group, dest_tag, replacement, src_tag, regex) staticmethod

timeSeriesReplaceTag(group, dest_tag, replacement, src_tag, regex)

  • group — A group of tags. UInt64
  • dest_tag — The name of a destination tag to get the result group. String
  • replacement — A replacement pattern, can contain $1, $2 or $name to refer capturing groups in the regular expression 'regex'. String
  • src_tag — The name of a tag which value is used to match the regular expression 'regex'. String
  • regex — A regular expression. String

A new group of tags with maybe dest_tag added. UInt64

timeSeriesResampleToGridWithStaleness(start_timestamp, end_timestamp, grid_step, staleness_window) staticmethod

timeSeriesResampleToGridWithStaleness(start_timestamp, end_timestamp, grid_step, staleness_window)(timestamp, value)

Returns time series values re-sampled to the specified grid. The returned array contains one value for each time grid point. The value is NULL if there is no sample for a particular grid point. Array(Nullable(Float64))

timeSeriesResetsToGrid(start_timestamp, end_timestamp, grid_step, staleness) staticmethod

timeSeriesResetsToGrid(start_timestamp, end_timestamp, grid_step, staleness)(timestamp, value)

  • timestamp — Timestamp of the sample. Can be individual values or arrays. - value — Value of the time series corresponding to the timestamp. Can be individual values or arrays. resets values on the specified grid as an Array(Nullable(Float64)). The returned array contains one value for each time grid point. The value is NULL if there are no samples within the window to calculate the resets value for a particular grid point.

timeSeriesStoreTags(id, tags_array, separate_tag_name_1, separate_tag_value_1) staticmethod

timeSeriesStoreTags(id, tags_array, separate_tag_name_1, separate_tag_value_1, ...)

Returns the identifier of a time series (i.e. just the first argument).

timeSeriesTagsToGroup(tags_array, tag_name_1, tag_value_1, tag_name2, tag_value2) staticmethod

timeSeriesTagsToGroup(tags_array, tag_name_1, tag_value_1, tag_name2, tag_value2, ...)

Returns a group of tags associated with the specified tags. UInt64

timeSeriesThrowDuplicateSeriesIf(condition, group) staticmethod

timeSeriesThrowDuplicateSeriesIf(condition, group)

  • condition — Condition to check, usually contains function count() UInt8
  • group — Group of tags. UInt64

Returns 0. UInt8

timeSlot(time, time_zone=None) staticmethod

timeSlot(time[, time_zone])

  • time — Time to round to the start of a half-an-hour length interval. DateTime or Date32 or DateTime64
  • time_zone — Optional. A String type const value or an expression representing the time zone. String

Returns the time rounded to the start of a half-an-hour length interval. DateTime

timeSlots(StartTime, Duration, Size=None) staticmethod

timeSlots(StartTime, Duration[, Size])

Returns an array of DateTime/DateTime64 (return type matches the type of StartTime). For DateTime64, the return value's scale can differ from the scale of StartTime - the highest scale among all given arguments is taken. Array(DateTime) or Array(DateTime64)

timestamp(expr, expr_time=None) staticmethod

timestamp(expr[, expr_time])

  • expr — Date or date with time. String
  • expr_time — Optional. Time to add to the converted value. String

Returns the converted value of expr, or expr with added time DateTime64(6)

timezone() staticmethod

timezone()

Returns the canonical time zone name as a String

timezoneOf(datetime) staticmethod

timezoneOf(datetime)

  • datetime — A value of type. DateTime or DateTime64
  • timezone — Optional. Timezone name to convert the datetime value's timezone to. String

Returns the timezone name for datetime String

timezoneOffset(datetime) staticmethod

timezoneOffset(datetime)

Returns the offset from UTC in seconds Int32

toBFloat16(expr) staticmethod

toBFloat16(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 16-bit brain-float value. BFloat16

toBFloat16OrNull(x) staticmethod

toBFloat16OrNull(x)

  • x — A String representation of a number. String

Reurns a 16-bit brain-float value, otherwise NULL. BFloat16 or NULL

toBFloat16OrZero(x) staticmethod

toBFloat16OrZero(x)

  • x — A String representation of a number. String

Returns a 16-bit brain-float value, otherwise 0. BFloat16

toBool(expr) staticmethod

toBool(expr)

  • expr — Expression returning a number or a string. For strings, accepts 'true' or 'false' (case-insensitive). (U)Int* or Float* or String or Expression

Returns true or false based on evaluation of the argument. Bool

toColumnTypeName(value) staticmethod

toColumnTypeName(value)

  • value — Value for which to return the internal data type. Any

Returns the internal data type used to represent the value. String

toDate(x) staticmethod

toDate(x)

Returns the converted input value. Date

toDate32(expr) staticmethod

toDate32(expr)

Returns a calendar date. Date32

toDate32OrDefault(expr, default=None) staticmethod

toDate32OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Date32

Value of type Date32 if successful, otherwise returns the default value if passed or 1900-01-01 if not. Date32

toDate32OrNull(x) staticmethod

toDate32OrNull(x)

  • x — A string representation of a date. String

Returns a Date32 value if successful, otherwise NULL. Date32 or NULL

toDate32OrZero(x) staticmethod

toDate32OrZero(x)

  • x — A string representation of a date. String

Returns a Date32 value if successful, otherwise the lower boundary of Date32 (1900-01-01). Date32

toDateOrDefault(expr, default=None) staticmethod

toDateOrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Date

Value of type Date if successful, otherwise returns the default value if passed or 1970-01-01 if not. Date

toDateOrNull(x) staticmethod

toDateOrNull(x)

  • x — A string representation of a date. String

Returns a Date value if successful, otherwise NULL. Date or NULL

toDateOrZero(x) staticmethod

toDateOrZero(x)

  • x — A string representation of a date. String

Returns a Date value if successful, otherwise the lower boundary of Date (1970-01-01). Date

toDateTime(expr, time_zone=None) staticmethod

toDateTime(expr[, time_zone])

Returns a date time. DateTime

toDateTime32(x, timezone=None) staticmethod

toDateTime32(x[, timezone])

Returns the converted input value. DateTime

toDateTime64(expr, scale, timezone=None) staticmethod

toDateTime64(expr, scale[, timezone])

  • expr — Expression returning a number or a string representation of a number. Expression
  • scale — Tick size (precision): 10^(-scale) seconds. UInt8
  • timezone — Optional. Time zone for the specified DateTime64 object. String

Returns a calendar date and time of day, with sub-second precision. DateTime64

toDateTime64OrDefault(expr, scale, timezone=None, default=None) staticmethod

toDateTime64OrDefault(expr, scale[, timezone, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • scale — Tick size (precision): 10^-precision seconds. UInt8
  • timezone — Optional. Time zone. String
  • default — Optional. The default value to return if parsing is unsuccessful. DateTime64

Value of type DateTime64 if successful, otherwise returns the default value if passed or 1970-01-01 00:00:00.000 if not. DateTime64

toDateTime64OrNull(x) staticmethod

toDateTime64OrNull(x)

  • x — A string representation of a date with time and subsecond precision. String

Returns a DateTime64 value if successful, otherwise NULL. DateTime64 or NULL

toDateTime64OrZero(x) staticmethod

toDateTime64OrZero(x)

  • x — A string representation of a date with time and subsecond precision. String

Returns a DateTime64 value if successful, otherwise the lower boundary of DateTime64 (1970-01-01 00:00:00.000). DateTime64

toDateTimeOrDefault(expr, timezone=None, default=None) staticmethod

toDateTimeOrDefault(expr[, timezone, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • timezone — Optional. Time zone. String
  • default — Optional. The default value to return if parsing is unsuccessful. DateTime

Value of type DateTime if successful, otherwise returns the default value if passed or 1970-01-01 00:00:00 if not. DateTime

toDateTimeOrNull(x) staticmethod

toDateTimeOrNull(x)

  • x — A string representation of a date with time. String

Returns a DateTime value if successful, otherwise NULL. DateTime or NULL

toDateTimeOrZero(x) staticmethod

toDateTimeOrZero(x)

  • x — A string representation of a date with time. String

Returns a DateTime value if successful, otherwise the lower boundary of DateTime (1970-01-01 00:00:00). DateTime

toDayOfMonth(datetime) staticmethod

toDayOfMonth(datetime)

Returns the day of the month of the given date/time UInt8

toDayOfWeek(datetime, mode=None, timezone=None) staticmethod

toDayOfWeek(datetime[, mode[, timezone]])

  • datetime — Date or date with time to get the day of week from. Date or Date32 or DateTime or DateTime64
  • mode — Optional. Integer specifying the week mode (0-3). Defaults to 0 if omitted. UInt8
  • timezone — Optional. Timezone to use for the conversion. String

Returns the day of the week for the given Date or DateTime UInt8

toDayOfYear(datetime) staticmethod

toDayOfYear(datetime)

Returns the day of the year of the given Date or DateTime UInt16

toDaysInMonth(datetime) staticmethod

toDaysInMonth(datetime)

Returns the number of days in the month of the given date/time. UInt8

toDaysSinceYearZero(date, time_zone=None) staticmethod

toDaysSinceYearZero(date[, time_zone])

  • date — The date or date with time for which to calculate the number of days since year zero from. Date or Date32 or DateTime or DateTime64
  • time_zone — Time zone. String

Returns the number of days passed since date 0000-01-01. UInt32

toDecimal128(expr, S) staticmethod

toDecimal128(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 38, specifying how many digits the fractional part of a number can have. UInt8

Returns a value of type Decimal(38, S) Decimal128(S)

toDecimal128OrDefault(expr, S, default=None) staticmethod

toDecimal128OrDefault(expr, S[, default])

  • expr — A String representation of a number. String
  • S — Scale parameter between 0 and 38, specifying how many digits the fractional part of a number can have. UInt8
  • default — Optional. The default value to return if parsing to type Decimal128(S) is unsuccessful. Decimal128(S)

Value of type Decimal(38, S) if successful, otherwise returns the default value if passed or 0 if not. Decimal128(S)

toDecimal128OrNull(expr, S) staticmethod

toDecimal128OrNull(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 38, specifying how many digits the fractional part of a number can have. UInt8

Returns a Decimal(38, S) value if successful, otherwise NULL. Decimal128(S) or NULL

toDecimal128OrZero(expr, S) staticmethod

toDecimal128OrZero(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 38, specifying how many digits the fractional part of a number can have. UInt8

Returns a Decimal(38, S) value if successful, otherwise 0. Decimal128(S)

toDecimal256(expr, S) staticmethod

toDecimal256(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 76, specifying how many digits the fractional part of a number can have. UInt8

Returns a value of type Decimal(76, S). Decimal256(S)

toDecimal256OrDefault(expr, S, default=None) staticmethod

toDecimal256OrDefault(expr, S[, default])

  • expr — A String representation of a number. String
  • S — Scale parameter between 0 and 76, specifying how many digits the fractional part of a number can have. UInt8
  • default — Optional. The default value to return if parsing to type Decimal256(S) is unsuccessful. Decimal256(S)

Value of type Decimal(76, S) if successful, otherwise returns the default value if passed or 0 if not. Decimal256(S)

toDecimal256OrNull(expr, S) staticmethod

toDecimal256OrNull(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 76, specifying how many digits the fractional part of a number can have. UInt8

Returns a Decimal(76, S) value if successful, otherwise NULL. Decimal256(S) or NULL

toDecimal256OrZero(expr, S) staticmethod

toDecimal256OrZero(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 76, specifying how many digits the fractional part of a number can have. UInt8

Returns a Decimal(76, S) value if successful, otherwise 0. Decimal256(S)

toDecimal32(expr, S) staticmethod

toDecimal32(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 9, specifying how many digits the fractional part of a number can have. UInt8

Returns a value of type Decimal(9, S) Decimal32(S)

toDecimal32OrDefault(expr, S, default=None) staticmethod

toDecimal32OrDefault(expr, S[, default])

  • expr — A String representation of a number. String
  • S — Scale parameter between 0 and 9, specifying how many digits the fractional part of a number can have. UInt8
  • default — Optional. The default value to return if parsing to type Decimal32(S) is unsuccessful. Decimal32(S)

Value of type Decimal(9, S) if successful, otherwise returns the default value if passed or 0 if not. Decimal32(S)

toDecimal32OrNull(expr, S) staticmethod

toDecimal32OrNull(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 9, specifying how many digits the fractional part of a number can have. UInt8

Returns a Decimal(9, S) value if successful, otherwise NULL. Decimal32(S) or NULL

toDecimal32OrZero(expr, S) staticmethod

toDecimal32OrZero(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 9, specifying how many digits the fractional part of a number can have. UInt8

Returns a Decimal(9, S) value if successful, otherwise 0. Decimal32(S)

toDecimal64(expr, S) staticmethod

toDecimal64(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 18, specifying how many digits the fractional part of a number can have. UInt8

Returns a decimal value. Decimal(18, S)

toDecimal64OrDefault(expr, S, default=None) staticmethod

toDecimal64OrDefault(expr, S[, default])

  • expr — A String representation of a number. String
  • S — Scale parameter between 0 and 18, specifying how many digits the fractional part of a number can have. UInt8
  • default — Optional. The default value to return if parsing to type Decimal64(S) is unsuccessful. Decimal64(S)

Value of type Decimal(18, S) if successful, otherwise returns the default value if passed or 0 if not. Decimal64(S)

toDecimal64OrNull(expr, S) staticmethod

toDecimal64OrNull(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 18, specifying how many digits the fractional part of a number can have. UInt8

Returns a Decimal(18, S) value if successful, otherwise NULL. Decimal64(S) or NULL

toDecimal64OrZero(expr, S) staticmethod

toDecimal64OrZero(expr, S)

  • expr — Expression returning a number or a string representation of a number. Expression
  • S — Scale parameter between 0 and 18, specifying how many digits the fractional part of a number can have. UInt8

Returns a Decimal(18, S) value if successful, otherwise 0. Decimal64(S)

toDecimalString(number, scale) staticmethod

toDecimalString(number, scale)

Returns a String representation of the number with exactly the specified number of fractional digits. String

toFixedString(s, N) staticmethod

toFixedString(s, N)

  • s — String to convert. String
  • N — Length of the resulting FixedString. const UInt*

Returns a FixedString of length N. FixedString(N)

toFloat32(expr) staticmethod

toFloat32(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 32-bit floating point value. Float32

toFloat32OrDefault(expr, default=None) staticmethod

toFloat32OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Float32

Returns a value of type Float32 if successful, otherwise returns the default value if passed or 0 if not. Float32

toFloat32OrNull(x) staticmethod

toFloat32OrNull(x)

  • x — A string representation of a number. String

Returns a 32-bit Float value if successful, otherwise NULL. Float32 or NULL

toFloat32OrZero(x) staticmethod

toFloat32OrZero(x)

  • x — A string representation of a number. String

Returns a 32-bit Float value if successful, otherwise 0. Float32

toFloat64(expr) staticmethod

toFloat64(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 64-bit floating point value. Float64

toFloat64OrDefault(expr, default=None) staticmethod

toFloat64OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Float64

Returns a value of type Float64 if successful, otherwise returns the default value if passed or 0 if not. Float64

toFloat64OrNull(x) staticmethod

toFloat64OrNull(x)

  • x — A string representation of a number. String

Returns a 64-bit Float value if successful, otherwise NULL. Float64 or NULL

toFloat64OrZero(x) staticmethod

toFloat64OrZero(x)

  • x — A string representation of a number. String

Returns a 64-bit Float value if successful, otherwise 0. Float64

toHour(datetime) staticmethod

toHour(datetime)

Returns the hour (0-23) of datetime. UInt8

toIPv4(x) staticmethod

toIPv4(x)

Returns an IPv4 address. IPv4

toIPv4OrDefault(string, default=None) staticmethod

toIPv4OrDefault(string[, default])

  • string — IP address string to convert. String
  • default — Optional. The value to return if string is an invalid IPv4 address. IPv4

Returns a string converted to the current IPv4 address, or the default value if conversion fails. IPv4

toIPv4OrNull(x) staticmethod

toIPv4OrNull(x)

  • x — A string or integer representation of an IPv4 address. String or Integer

Returns an IPv4 address if successful, otherwise NULL. IPv4 or NULL

toIPv4OrZero(x) staticmethod

toIPv4OrZero(x)

  • x — A string or integer representation of an IPv4 address. String or Integer

Returns an IPv4 address if successful, otherwise zero IPv4 address (0.0.0.0). IPv4

toIPv6(x) staticmethod

toIPv6(x)

Returns an IPv6 address. IPv6

toIPv6OrDefault(string, default=None) staticmethod

toIPv6OrDefault(string[, default])

  • string — IP address string to convert. - default — Optional. The value to return if string has an invalid format. Returns the IPv6 address, otherwise :: or the provided optional default if argument string has an invalid format. IPv6

toIPv6OrNull(x) staticmethod

toIPv6OrNull(x)

  • x — A string representation of an IPv6 or IPv4 address. String

Returns an IPv6 address if successful, otherwise NULL. IPv6 or NULL

toIPv6OrZero(x) staticmethod

toIPv6OrZero(x)

  • x — A string representation of an IPv6 or IPv4 address. String

Returns an IPv6 address if successful, otherwise zero IPv6 address (::). IPv6

toISOWeek(datetime, timezone=None) staticmethod

toISOWeek(datetime[, timezone])

Returns the ISO week number according to ISO 8601 standard. Returns a number between 1 and 53. UInt8

toISOYear(datetime) staticmethod

toISOYear(datetime)

Returns the input value converted to an ISO year number. UInt16

toInt128(expr) staticmethod

toInt128(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 128-bit integer value. Int128

toInt128OrDefault(expr, default=None) staticmethod

toInt128OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Int128

Returns a value of type Int128 if successful, otherwise returns the default value if passed, or 0 if not. Int128

toInt128OrNull(x) staticmethod

toInt128OrNull(x)

  • x — A String representation of a number. String

Returns a value of type Int128, otherwise NULL if the conversion is unsuccessful. Int128 or NULL

toInt128OrZero(x) staticmethod

toInt128OrZero(x)

Returns the converted input value, otherwise 0 if conversion fails. Int128

toInt16(expr) staticmethod

toInt16(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 16-bit integer value. Int16

toInt16OrDefault(expr, default=None) staticmethod

toInt16OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Int16

Returns a value of type Int16 if successful, otherwise returns the default value if passed, or 0 if not. Int16

toInt16OrNull(x) staticmethod

toInt16OrNull(x)

  • x — A String representation of a number. String

Returns a value of type Int16, otherwise NULL if the conversion is unsuccessful. Int16 or NULL

toInt16OrZero(x) staticmethod

toInt16OrZero(x)

  • x — A String representation of a number. String

Returns a value of type Int16, otherwise 0 if the conversion is unsuccessful. Int16

toInt256(expr) staticmethod

toInt256(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 256-bit integer value. Int256

toInt256OrDefault(expr, default=None) staticmethod

toInt256OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Int256

Returns a value of type Int256 if successful, otherwise returns the default value if passed, or 0 if not. Int256

toInt256OrNull(x) staticmethod

toInt256OrNull(x)

  • x — A String representation of a number. String

Returns a value of type Int256, otherwise NULL if the conversion is unsuccessful. Int256 or NULL

toInt256OrZero(x) staticmethod

toInt256OrZero(x)

Returns the converted input value, otherwise 0 if conversion fails. Int256

toInt32(expr) staticmethod

toInt32(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 32-bit integer value. Int32

toInt32OrDefault(expr, default=None) staticmethod

toInt32OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Int32

Returns a value of type Int32 if successful, otherwise returns the default value if passed or 0 if not. Int32

toInt32OrNull(x) staticmethod

toInt32OrNull(x)

  • x — A String representation of a number. String

Returns a value of type Int32, otherwise NULL if the conversion is unsuccessful. Int32 or NULL

toInt32OrZero(x) staticmethod

toInt32OrZero(x)

  • x — A String representation of a number. String

Returns a value of type Int32, otherwise 0 if the conversion is unsuccessful. Int32

toInt64(expr) staticmethod

toInt64(expr)

  • expr — Expression returning a number or a string representation of a number. Supported: values or string representations of type (U)Int, values of type Float. Unsupported: string representations of Float* values including NaN and Inf, string representations of binary and hexadecimal values. Expression

Returns a 64-bit integer value. Int64

toInt64OrDefault(expr, default=None) staticmethod

toInt64OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Int64

Returns a value of type Int64 if successful, otherwise returns the default value if passed, or 0 if not. Int64

toInt64OrNull(x) staticmethod

toInt64OrNull(x)

  • x — A String representation of a number. String

Returns a value of type Int64, otherwise NULL if the conversion is unsuccessful. Int64 or NULL

toInt64OrZero(x) staticmethod

toInt64OrZero(x)

Returns the converted input value, otherwise 0 if conversion fails. Int64

toInt8(expr) staticmethod

toInt8(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns an 8-bit integer value. Int8

toInt8OrDefault(expr, default=None) staticmethod

toInt8OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. Int8

Returns a value of type Int8 if successful, otherwise returns the default value if passed, or 0 if not. Int8

toInt8OrNull(x) staticmethod

toInt8OrNull(x)

  • x — A String representation of a number. String

Returns a value of type Int8, otherwise NULL if the conversion is unsuccessful. Int8 or NULL

toInt8OrZero(x) staticmethod

toInt8OrZero(x)

  • x — A String representation of a number. String

Returns a value of type Int8, otherwise 0 if the conversion is unsuccessful. Int8

toInterval(value, unit) staticmethod

toInterval(value, unit)

  • value — The numeric value representing the number of units. Can be any numeric type. Int8 or Int16 or Int32 or Int64 or UInt8 or UInt16 or UInt32 or UInt64 or Float32 or Float64
  • unit — The unit of time. Must be a constant string. Valid values: 'nanosecond', 'microsecond', 'millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'. String

Returns an Interval value of the specified type. The result type depends on the unit: IntervalNanosecond, IntervalMicrosecond, IntervalMillisecond, IntervalSecond, IntervalMinute, IntervalHour, IntervalDay, IntervalWeek, IntervalMonth, IntervalQuarter, or IntervalYear. Interval

toIntervalDay(n) staticmethod

toIntervalDay(n)

  • n — Number of days. Integer numbers or string representations thereof, and float numbers. (U)Int* or Float* or String

Returns an interval of n days. Interval

toIntervalHour(n) staticmethod

toIntervalHour(n)

  • n — Number of hours. Integer numbers or string representations thereof, and float numbers. Int* or UInt* or Float* or String

Returns an interval of n hours. Interval

toIntervalMicrosecond(n) staticmethod

toIntervalMicrosecond(n)

Returns an interval of n microseconds. Interval

toIntervalMillisecond(n) staticmethod

toIntervalMillisecond(n)

Returns an interval of n milliseconds. Interval

toIntervalMinute(n) staticmethod

toIntervalMinute(n)

  • n — Number of minutes. Integer numbers or string representations thereof, and float numbers. (U)Int* or Float* or String

Returns an interval of n minutes. Interval

toIntervalMonth(n) staticmethod

toIntervalMonth(n)

Returns an interval of n months. Interval

toIntervalNanosecond(n) staticmethod

toIntervalNanosecond(n)

Returns an interval of n nanoseconds. Interval

toIntervalQuarter(n) staticmethod

toIntervalQuarter(n)

Returns an interval of n quarters. Interval

toIntervalSecond(n) staticmethod

toIntervalSecond(n)

  • n — Number of seconds. Integer numbers or string representations thereof, and float numbers. (U)Int* or Float* or String

Returns an interval of n seconds. Interval

toIntervalWeek(n) staticmethod

toIntervalWeek(n)

Returns an interval of n weeks. Interval

toIntervalYear(n) staticmethod

toIntervalYear(n)

Returns an interval of n years. Interval

toJSONString(value) staticmethod

toJSONString(value)

  • value — Value to serialize. Value may be of any data type. Any

Returns the JSON representation of the value. String

toLastDayOfMonth(value) staticmethod

toLastDayOfMonth(value)

Returns the date of the last day of the month for the given date or date with time. Date

toLastDayOfWeek(datetime, mode=None, timezone=None) staticmethod

toLastDayOfWeek(datetime[, mode[, timezone]])

  • datetime — A date or date with time to convert. Date or DateTime or Date32 or DateTime64
  • mode — Determines the first day of the week as described in the toWeek() function. Default 0. UInt8
  • timezone — Optional. The timezone to use for the conversion. If not specified, the server's timezone is used. String

Returns the date of the nearest Saturday or Sunday, on or after the given date, depending on the mode Date or Date32 or DateTime or DateTime64

toLowCardinality(expr) staticmethod

toLowCardinality(expr)

Returns the input value converted to the LowCardinality data type. LowCardinality

toMillisecond(datetime) staticmethod

toMillisecond(datetime)

Returns the millisecond in the minute (0 - 59) of datetime. UInt16

toMinute(datetime) staticmethod

toMinute(datetime)

Returns the minute of the hour (0 - 59) of datetime. UInt8

toModifiedJulianDay(date) staticmethod

toModifiedJulianDay(date)

Returns Modified Julian Day number. Int32

toModifiedJulianDayOrNull(date) staticmethod

toModifiedJulianDayOrNull(date)

Returns the modified Julian day number for valid date, otherwise null. Nullable(Int32)

toMonday(value) staticmethod

toMonday(value)

Returns the date of the Monday of the same week for the given date or date with time. Date

toMonth(datetime) staticmethod

toMonth(datetime)

Returns the month of the given date/time UInt8

toMonthNumSinceEpoch(date) staticmethod

toMonthNumSinceEpoch(date)

Positive integer

toNullable(x) staticmethod

toNullable(x)

  • x — A value of any non-compound type. Any

Returns the input value but of Nullable type. Nullable(Any)

toQuarter(datetime) staticmethod

toQuarter(datetime)

Returns the quarter of the year for the given date/time UInt8

toRelativeDayNum(date) staticmethod

toRelativeDayNum(date)

Returns the number of days from a fixed reference point in the past. UInt32

toRelativeHourNum(date) staticmethod

toRelativeHourNum(date)

Returns the number of hours from a fixed reference point in the past. UInt32

toRelativeMinuteNum(date) staticmethod

toRelativeMinuteNum(date)

Returns the number of minutes from a fixed reference point in the past. UInt32

toRelativeMonthNum(date) staticmethod

toRelativeMonthNum(date)

Returns the number of months from a fixed reference point in the past. UInt32

toRelativeQuarterNum(date) staticmethod

toRelativeQuarterNum(date)

Returns the number of quarters from a fixed reference point in the past. UInt32

toRelativeSecondNum(date) staticmethod

toRelativeSecondNum(date)

Returns the number of seconds from a fixed reference point in the past. UInt32

toRelativeWeekNum(date) staticmethod

toRelativeWeekNum(date)

Returns the number of weeks from a fixed reference point in the past. UInt32

toRelativeYearNum(date) staticmethod

toRelativeYearNum(date)

Returns the number of years from a fixed reference point in the past. UInt16

toSecond(datetime) staticmethod

toSecond(datetime)

Returns the second in the minute (0 - 59) of datetime. UInt8

toStartOfDay(datetime) staticmethod

toStartOfDay(datetime)

  • datetime — A date or date with time to round. Date or DateTime

Returns the date with time rounded down to the start of the day. Date or DateTime or Date32 or DateTime64

toStartOfFifteenMinutes(datetime) staticmethod

toStartOfFifteenMinutes(datetime)

Returns the date with time rounded to the start of the nearest fifteen-minute interval DateTime or DateTime64

toStartOfFiveMinutes(datetime) staticmethod

toStartOfFiveMinutes(datetime)

Returns the date with time rounded to the start of the nearest five-minute interval DateTime or DateTime64

toStartOfHour(datetime) staticmethod

toStartOfHour(datetime)

Returns the date with time rounded down to the start of the hour. DateTime or DateTime64

toStartOfISOYear(value) staticmethod

toStartOfISOYear(value)

Returns the first day of the ISO year for the given date or date with time. Date

toStartOfInterval(value, INTERVAL, x, unit, time_zone=None) staticmethod

toStartOfInterval(value, INTERVAL x unit[, time_zone]) toStartOfInterval(value, INTERVAL x unit[, origin[, time_zone]])

  • value — Date or date with time value to round down. Date or DateTime or DateTime64
  • x — Interval length number. - unit — Interval unit: YEAR, QUARTER, MONTH, WEEK, DAY, HOUR, MINUTE, SECOND, MILLISECOND, MICROSECOND, NANOSECOND. - time_zone — Optional. Time zone name as a string. - origin — Optional. Origin point for calculation (second overload only). Returns the start of the interval containing the input value. DateTime

toStartOfMicrosecond(datetime, timezone=None) staticmethod

toStartOfMicrosecond(datetime[, timezone])

  • datetime — Date and time. DateTime64
  • timezone — Optional. Timezone for the returned value. If not specified, the function uses the timezone of the value parameter. String

Input value with sub-microseconds DateTime64

toStartOfMillisecond(datetime, timezone=None) staticmethod

toStartOfMillisecond(datetime[, timezone])

  • datetime — Date and time. DateTime64
  • timezone — Optional. Timezone for the returned value. If not specified, the function uses the timezone of the value parameter. String

Input value with sub-milliseconds. DateTime64

toStartOfMinute(datetime) staticmethod

toStartOfMinute(datetime)

Returns the date with time rounded down to the start of the minute. DateTime or DateTime64

toStartOfMonth(value) staticmethod

toStartOfMonth(value)

Returns the first day of the month for the given date or date with time. Date

toStartOfNanosecond(datetime, timezone=None) staticmethod

toStartOfNanosecond(datetime[, timezone])

  • datetime — Date and time. DateTime64
  • timezone — Optional. Timezone for the returned value. If not specified, the function uses the timezone of the value parameter. String

Input value with nanoseconds. DateTime64

toStartOfQuarter(value) staticmethod

toStartOfQuarter(value)

Returns the first day of the quarter for the given date or date with time. Date

toStartOfSecond(datetime, timezone=None) staticmethod

toStartOfSecond(datetime[, timezone])

  • datetime — Date and time to truncate sub-seconds from. DateTime64
  • timezone — Optional. Timezone for the returned value. If not specified, the function uses the timezone of the value parameter. String

Returns the input value without sub-seconds. DateTime64

toStartOfTenMinutes(datetime) staticmethod

toStartOfTenMinutes(datetime)

Returns the date with time rounded to the start of the nearest ten-minute interval DateTime or DateTime64

toStartOfWeek(datetime, mode=None, timezone=None) staticmethod

toStartOfWeek(datetime[, mode[, timezone]])

  • datetime — A date or date with time to convert. Date or DateTime or Date32 or DateTime64
  • mode — Determines the first day of the week as described in the toWeek() function. Default 0. UInt8
  • timezone — The timezone to use for the conversion. If not specified, the server's timezone is used. String

Returns the date of the nearest Sunday or Monday on, or prior to, the given date, depending on the mode Date or Date32 or DateTime or DateTime64

toStartOfYear(value) staticmethod

toStartOfYear(value)

Returns the first day of the year for the given date/time Date

toString(value, timezone=None) staticmethod

toString(value[, timezone])

  • value — Value to convert to string. Any
  • timezone — Optional. Timezone name for DateTime conversion. String

Returns a string representation of the input value. String

toStringCutToZero(s) staticmethod

toStringCutToZero(s)

Returns a String containing the characters before the first null byte. String

toTime(x) staticmethod

toTime(x)

Returns the converted value. Time

toTime64(x) staticmethod

toTime64(x)

Returns the converted input value with microsecond precision. Time64(6)

toTime64OrNull(x) staticmethod

toTime64OrNull(x)

  • x — A string representation of a time with subsecond precision. String

Returns a Time64 value if successful, otherwise NULL. Time64 or NULL

toTime64OrZero(x) staticmethod

toTime64OrZero(x)

  • x — A string representation of a time with subsecond precision. String

Returns a Time64 value if successful, otherwise 00:00:00.000. Time64

toTimeOrNull(x) staticmethod

toTimeOrNull(x)

  • x — A string representation of a time. String

Returns a Time value if successful, otherwise NULL. Time or NULL

toTimeOrZero(x) staticmethod

toTimeOrZero(x)

  • x — A string representation of a time. String

Returns a Time value if successful, otherwise 00:00:00. Time

toTimeWithFixedDate(date, timezone=None) staticmethod

toTimeWithFixedDate(date[, timezone])

Returns the time component of a date or date with time in the form of an offset to a fixed point in time (selected as 1970-01-02, currently). DateTime

toTimezone(datetime, timezone) staticmethod

toTimezone(datetime, timezone)

Returns the same timestamp as the input, but with the specified time zone DateTime or DateTime64

toTypeName(x) staticmethod

toTypeName(x)

  • x — A value of arbitrary type. Any

Returns the data type name of the input value. String

toUInt128(expr) staticmethod

toUInt128(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 128-bit unsigned integer value. UInt128

toUInt128OrDefault(expr, default=None) staticmethod

toUInt128OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. UInt128

Returns a value of type UInt128 if successful, otherwise returns the default value if passed, or 0 if not. UInt128

toUInt128OrNull(x) staticmethod

toUInt128OrNull(x)

  • x — A String representation of a number. String

Returns a value of type UInt128, otherwise NULL if the conversion is unsuccessful. UInt128 or NULL

toUInt128OrZero(x) staticmethod

toUInt128OrZero(x)

  • x — A String representation of a number. String

Returns a value of type UInt128, otherwise 0 if the conversion is unsuccessful. UInt128

toUInt16(expr) staticmethod

toUInt16(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 16-bit unsigned integer value. UInt16

toUInt16OrDefault(expr, default=None) staticmethod

toUInt16OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. UInt16

Returns a value of type UInt16 if successful, otherwise returns the default value if passed, or 0 if not. UInt16

toUInt16OrNull(x) staticmethod

toUInt16OrNull(x)

  • x — A String representation of a number. String

Returns a value of type UInt16, otherwise NULL if the conversion is unsuccessful. UInt16 or NULL

toUInt16OrZero(x) staticmethod

toUInt16OrZero(x)

  • x — A String representation of a number. String

Returns a value of type UInt16, otherwise 0 if the conversion is unsuccessful. UInt16

toUInt256(expr) staticmethod

toUInt256(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 256-bit unsigned integer value. UInt256

toUInt256OrDefault(expr, default=None) staticmethod

toUInt256OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. UInt256

Returns a value of type UInt256 if successful, otherwise returns the default value if passed, or 0 if not. UInt256

toUInt256OrNull(x) staticmethod

toUInt256OrNull(x)

  • x — A String representation of a number. String

Returns a value of type UInt256, otherwise NULL if the conversion is unsuccessful. UInt256 or NULL

toUInt256OrZero(x) staticmethod

toUInt256OrZero(x)

  • x — A String representation of a number. String

Returns a value of type UInt256, otherwise 0 if the conversion is unsuccessful. UInt256

toUInt32(expr) staticmethod

toUInt32(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 32-bit unsigned integer value. UInt32

toUInt32OrDefault(expr, default=None) staticmethod

toUInt32OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. UInt32

Returns a value of type UInt32 if successful, otherwise returns the default value if passed, or 0 if not. UInt32

toUInt32OrNull(x) staticmethod

toUInt32OrNull(x)

  • x — A String representation of a number. String

Returns a value of type UInt32, otherwise NULL if the conversion is unsuccessful. UInt32 or NULL

toUInt32OrZero(x) staticmethod

toUInt32OrZero(x)

  • x — A String representation of a number. String

Returns a value of type UInt32, otherwise 0 if the conversion is unsuccessful. UInt32

toUInt64(expr) staticmethod

toUInt64(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns a 64-bit unsigned integer value. UInt64

toUInt64OrDefault(expr, default=None) staticmethod

toUInt64OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. UInt64

Returns a value of type UInt64 if successful, otherwise returns the default value if passed, or 0 if not. UInt64

toUInt64OrNull(x) staticmethod

toUInt64OrNull(x)

  • x — A String representation of a number. String

Returns a value of type UInt64, otherwise NULL if the conversion is unsuccessful. UInt64 or NULL

toUInt64OrZero(x) staticmethod

toUInt64OrZero(x)

  • x — A String representation of a number. String

Returns a value of type UInt64, otherwise 0 if the conversion is unsuccessful. UInt64

toUInt8(expr) staticmethod

toUInt8(expr)

  • expr — Expression returning a number or a string representation of a number. Expression

Returns an 8-bit unsigned integer value. UInt8

toUInt8OrDefault(expr, default=None) staticmethod

toUInt8OrDefault(expr[, default])

  • expr — Expression returning a number or a string representation of a number. String or (U)Int* or Float*
  • default — Optional. The default value to return if parsing is unsuccessful. UInt8

Returns a value of type UInt8 if successful, otherwise returns the default value if passed, or 0 if not. UInt8

toUInt8OrNull(x) staticmethod

toUInt8OrNull(x)

  • x — A String representation of a number. String

Returns a value of type UInt8, otherwise NULL if the conversion is unsuccessful. UInt8 or NULL

toUInt8OrZero(x) staticmethod

toUInt8OrZero(x)

  • x — A String representation of a number. String

Returns a value of type UInt8, otherwise 0 if the conversion is unsuccessful. UInt8

toUTCTimestamp(datetime, time_zone) staticmethod

toUTCTimestamp(datetime, time_zone)

  • datetime — A date or date with time type const value or an expression. DateTime or DateTime64
  • time_zone — A String type const value or an expression representing the time zone. String

Returns a date or date with time in UTC timezone. DateTime or DateTime64

toUUID(string) staticmethod

toUUID(string)

Returns a UUID from the string representation of the UUID. UUID

toUUIDOrDefault(string, default) staticmethod

toUUIDOrDefault(string, default)

  • string — String of 36 characters or FixedString(36) to be converted to UUID. - default — UUID value to be returned if the first argument cannot be converted to UUID type. Returns the converted UUID if successful, or the default UUID if conversion fails. UUID

toUUIDOrNull(x) staticmethod

toUUIDOrNull(x)

  • x — A string representation of a UUID. String

Returns a UUID value if successful, otherwise NULL. UUID or NULL

toUUIDOrZero(x) staticmethod

toUUIDOrZero(x)

  • x — A string representation of a UUID. String

Returns a UUID value if successful, otherwise zero UUID (00000000-0000-0000-0000-000000000000). UUID

toUnixTimestamp(date, timezone=None) staticmethod

toUnixTimestamp(date[, timezone])

Returns the Unix timestamp. UInt32

toUnixTimestamp64Micro(value) staticmethod

toUnixTimestamp64Micro(value)

  • value — DateTime64 value with any precision. DateTime64

Returns a Unix timestamp in microseconds. Int64

toUnixTimestamp64Milli(value) staticmethod

toUnixTimestamp64Milli(value)

  • value — DateTime64 value with any precision. DateTime64

Returns a Unix timestamp in milliseconds. Int64

toUnixTimestamp64Nano(value) staticmethod

toUnixTimestamp64Nano(value)

  • value — DateTime64 value with any precision. DateTime64

Returns a Unix timestamp in nanoseconds. Int64

toUnixTimestamp64Second(value) staticmethod

toUnixTimestamp64Second(value)

  • value — DateTime64 value with any precision. DateTime64

Returns a Unix timestamp in seconds. Int64

toValidUTF8(s) staticmethod

toValidUTF8(s)

  • s — Any set of bytes represented as the String data type object. String

Returns a valid UTF-8 string. String

toWeek(datetime, mode=None, time_zone=None) staticmethod

toWeek(datetime[, mode[, time_zone]])

  • datetime — Date or date with time to get the week number from. Date or DateTime
  • mode — Optional. A mode 0 to 9 determines the first day of the week and the range of the week number. Default 0. - time_zone — Optional. Time zone. String

Returns the week number according to the specified mode. UInt32

toYYYYMM(datetime, timezone=None) staticmethod

toYYYYMM(datetime[, timezone])

  • datetime — A date or date with time to convert. Date or Date32 or DateTime or DateTime64
  • timezone — Optional. Timezone for the conversion. If provided, the timezone must be a string constant. String

Returns a UInt32 number containing the year and month number (YYYY * 100 + MM). UInt32

toYYYYMMDD(datetime, timezone=None) staticmethod

toYYYYMMDD(datetime[, timezone])

  • datetime — A date or date with time to convert. Date or Date32 or DateTime or DateTime64
  • timezone — Optional. Timezone for the conversion. If provided, the timezone must be a string constant. String

Returns a UInt32 number containing the year, month and day (YYYY * 10000 + MM * 100 + DD). UInt32

toYYYYMMDDhhmmss(datetime, timezone=None) staticmethod

toYYYYMMDDhhmmss(datetime[, timezone])

  • datetime — Date or date with time to convert. Date or Date32 or DateTime or DateTime64
  • timezone — Optional. Timezone for the conversion. If provided, the timezone must be a string constant. String

Returns a UInt64 number containing the year, month, day, hour, minute and second (YYYY * 10000000000 + MM * 100000000 + DD * 1000000 + hh * 10000 + mm * 100 + ss). UInt64

toYear(datetime) staticmethod

toYear(datetime)

Returns the year of the given Date or DateTime UInt16

toYearNumSinceEpoch(date) staticmethod

toYearNumSinceEpoch(date)

Positive integer

toYearWeek(datetime, mode=None, timezone=None) staticmethod

toYearWeek(datetime[, mode[, timezone]])

  • datetime — Date or date with time to get the year and week of. Date or DateTime
  • mode — Optional. A mode 0 to 9 determines the first day of the week and the range of the week number. Default 0. - timezone — Optional. Time zone. String

Returns year and week number as a combined integer value. UInt32

today() staticmethod

today()

Returns the current date Date

tokens(value) staticmethod

tokens(value) -- 'splitByNonAlpha' tokenizer tokens(value, 'splitByNonAlpha') tokens(value, 'splitByString'[, separators]) tokens(value, 'ngrams'[, n]) tokens(value, 'sparseGrams'[, min_length, max_length[, min_cutoff_length]]) tokens(value, 'array') tokens(value, 'unicode_word'[, stop_words])

  • value — The input string. String or FixedString
  • tokenizer — The tokenizer to use. Valid arguments are splitByNonAlpha, ngrams, splitByString, array, sparseGrams, and unicode_word. Optional, if not set explicitly, defaults to splitByNonAlpha. const String
  • n — Only relevant if argument tokenizer is ngrams: An optional parameter which defines the length of the ngrams. If not set explicitly, defaults to 3. const UInt8
  • separators — Only relevant if argument tokenizer is split: An optional parameter which defines the separator strings. If not set explicitly, defaults to [' ']. const Array(String)
  • min_length — Only relevant if argument tokenizer is sparseGrams: An optional parameter which defines the minimum gram length, defaults to 3. const UInt8
  • max_length — Only relevant if argument tokenizer is sparseGrams: An optional parameter which defines the maximum gram length, defaults to 100. const UInt8
  • min_cutoff_length — Only relevant if argument tokenizer is sparseGrams: An optional parameter which defines the minimum cutoff length. const UInt8
  • stop_words — Only relevant if argument tokenizer is unicode_word: An optional parameter which defines the stop words. If not set explicitly, defaults to common CJK punctuation marks. const Array(String)

Returns the resulting array of tokens from input string. Array

tokensForLikePattern(value, tokenizer=None, tokenizer_specific_arguments=None) staticmethod

tokensForLikePattern(value[, tokenizer[, tokenizer_specific_arguments...]])

  • value — The input string. String or FixedString
  • tokenizer — The tokenizer to use. Valid arguments are splitByNonAlpha, ngrams, splitByString, array, sparseGrams, and unicode_word. Optional, if not set explicitly, defaults to splitByNonAlpha. const String
  • n — Only relevant if argument tokenizer is ngrams: An optional parameter which defines the length of the ngrams. If not set explicitly, defaults to 3. const UInt8
  • separators — Only relevant if argument tokenizer is split: An optional parameter which defines the separator strings. If not set explicitly, defaults to [' ']. const Array(String)
  • min_length — Only relevant if argument tokenizer is sparseGrams: An optional parameter which defines the minimum gram length, defaults to 3. const UInt8
  • max_length — Only relevant if argument tokenizer is sparseGrams: An optional parameter which defines the maximum gram length, defaults to 100. const UInt8
  • min_cutoff_length — Only relevant if argument tokenizer is sparseGrams: An optional parameter which defines the minimum cutoff length. const UInt8
  • stop_words — Only relevant if argument tokenizer is unicode_word: An optional parameter which defines the stop words. If not set explicitly, defaults to common CJK punctuation marks. const Array(String)

Returns the resulting array of tokens from input string. Array

topK(N) staticmethod

topK(N)(column) topK(N, load_factor)(column) topK(N, load_factor, 'counts')(column)

  • column — The name of the column for which to find the most frequent values. String

Returns an array of the approximately most frequent values, sorted in descending order of approximate frequency. Array

topKWeighted(N) staticmethod

topKWeighted(N)(column, weight) topKWeighted(N, load_factor)(column, weight) topKWeighted(N, load_factor, 'counts')(column, weight)

  • column — The name of the column for which to find the most frequent values. - weight — The weight. Every value is accounted weight times for frequency calculation. UInt64

Returns an array of the values with maximum approximate sum of weights. Array

topLevelDomain(url) staticmethod

topLevelDomain(url)

Returns the domain name if the input string can be parsed as a URL. Otherwise, an empty string. String

topLevelDomainRFC(url) staticmethod

topLevelDomainRFC(url)

Domain name if the input string can be parsed as a URL. Otherwise, an empty string. String

transactionID() staticmethod

transactionID()

Returns a tuple consisting of start_csn, local_tid and host_id. - start_csn: Global sequential number, the newest commit timestamp that was seen when this transaction began. - local_tid: Local sequential number that is unique for each transaction started by this host within a specific start_csn. - host_id: UUID of the host that has started this transaction. Tuple(UInt64, UInt64, UUID)

transactionLatestSnapshot() staticmethod

transactionLatestSnapshot()

Returns the latest snapshot (CSN) of a transaction. UInt64

transactionOldestSnapshot() staticmethod

transactionOldestSnapshot()

Returns the oldest snapshot (CSN) of a transaction. UInt64

transform(x, array_from, array_to, default=None) staticmethod

transform(x, array_from, array_to[, default])

Returns the corresponding value from array_to if x matches an element in array_from, otherwise returns default (if provided) or x (if default not provided). Any

translate(s, from_, to) staticmethod

translate(s, from, to)

  • s — The input string to translate. String
  • from — A constant ASCII string containing characters to replace. const String
  • to — A constant ASCII string containing replacement characters. const String

Returns a string with character translations applied. String

translateUTF8(s, from_, to) staticmethod

translateUTF8(s, from, to)

  • s — UTF-8 input string to translate. String
  • from — A constant UTF-8 string containing characters to replace. const String
  • to — A constant UTF-8 string containing replacement characters. const String

Returns a String data type value. String

trimBoth(s, trim_characters=None) staticmethod

trimBoth(s[, trim_characters])

  • s — String to trim. String
  • trim_characters — Optional. Characters to trim. If not specified, common whitespace characters are removed. String

Returns the string with specified characters trimmed from both ends. String

trimLeft(input, trim_characters=None) staticmethod

trimLeft(input[, trim_characters])

  • input — String to trim. String
  • trim_characters — Optional. Characters to trim. If not specified, common whitespace characters are removed. String

Returns the string with specified characters trimmed from the left. String

trimRight(s, trim_characters=None) staticmethod

trimRight(s[, trim_characters])

  • s — String to trim. String
  • trim_characters — Optional characters to trim. If not specified, common whitespace characters are removed. String

Returns the string with specified characters trimmed from the right. String

trunc(x, N=None) staticmethod

truncate(x[, N])

  • x — The value to round. Float* or Decimal* or (U)Int*
  • N — Optional. The number of decimal places to round to. Defaults to zero, which means rounding to an integer. (U)Int*

Returns a rounded number of the same type as x. Float* or Decimal* or (U)Int*

tryBase32Decode(encoded) staticmethod

tryBase32Decode(encoded)

  • encoded — String column or constant to decode. If the string is not valid Base32-encoded, returns an empty string in case of error. String

Returns a string containing the decoded value of the argument. String

tryBase58Decode(encoded) staticmethod

tryBase58Decode(encoded)

  • encoded — String column or constant. If the string is not valid Base58-encoded, returns an empty string in case of error. String

Returns a string containing the decoded value of the argument. String

tryBase64Decode(encoded) staticmethod

tryBase64Decode(encoded)

  • encoded — String column or constant to decode. If the string is not valid Base64-encoded, returns an empty string in case of error. String

Returns a string containing the decoded value of the argument. String

tryBase64URLDecode(encoded) staticmethod

tryBase64URLDecode(encoded)

  • encoded — String column or constant to decode. If the string is not valid Base64-encoded, returns an empty string in case of error. String

Returns a string containing the decoded value of the argument. String

tryDecrypt(mode, ciphertext, key, iv=None, aad=None) staticmethod

tryDecrypt(mode, ciphertext, key[, iv, aad])

  • mode — Decryption mode. String
  • ciphertext — Encrypted text that should be decrypted. String
  • key — Decryption key. String
  • iv — Optional. Initialization vector. Required for -gcm modes, optional for other modes. String
  • aad — Optional. Additional authenticated data. Won't decrypt if this value is incorrect. Works only in -gcm modes, for other modes throws an exception. String

Returns the decrypted String, or NULL if decryption fails. Nullable(String)

tryIdnaEncode(s) staticmethod

tryIdnaEncode(s)

Returns an ASCII representation of the input string according to the IDNA mechanism of the input value, or empty string if input is invalid. String

tryPunycodeDecode(s) staticmethod

tryPunycodeDecode(s)

  • s — Punycode-encoded string. String

Returns the plaintext of the input value, or empty string if input is invalid. String

tumble(time_attr, interval, timezone=None) staticmethod

tumble(time_attr, interval[, timezone])

  • time_attr — Date and time. DateTime
  • interval — Window interval in Interval. Interval
  • timezone — Optional. Timezone name. String

Returns the inclusive lower and exclusive upper bound of the corresponding tumbling window. Tuple(DateTime, DateTime)

tumbleEnd(time_attr, interval, timezone=None) staticmethod

tumbleEnd(time_attr, interval[, timezone])

  • time_attr — Date and time. DateTime
  • interval — Window interval in Interval. Interval
  • timezone — Optional. Timezone name. String

Returns the exclusive upper bound of the corresponding tumbling window. DateTime

tumbleStart(time_attr, interval, timezone=None) staticmethod

tumbleStart(time_attr, interval[, timezone])

  • time_attr — Date and time. DateTime
  • interval — Window interval in Interval. Interval
  • timezone — Optional. Timezone name. String

Returns the inclusive lower bound of the corresponding tumbling window. DateTime

tuple(t1=None, t2=None) staticmethod

tuple([t1[, t2[ ...]])

tupleConcat(tuple1, tuple2=None) staticmethod

tupleConcat(tuple1[, tuple2, [...]])

  • tupleN — Arbitrary number of arguments of Tuple type. Tuple(T)

Returns a tuple containing all elements from the input tuples. Tuple(T)

tupleDivide(t1, t2) staticmethod

tupleDivide(t1, t2)

Returns tuple with the result of division. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleDivideByNumber(tuple, number) staticmethod

tupleDivideByNumber(tuple, number)

Returns a tuple with divided elements. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleElement(tuple, index, name, default_value=None) staticmethod

tupleElement(tuple, index|name[, default_value])

Returns the element at the specified index or name. Any

tupleHammingDistance(t1, t2) staticmethod

tupleHammingDistance(t1, t2)

Returns the Hamming distance. UInt8/16/32/64

tupleIntDiv(tuple_num, tuple_div) staticmethod

tupleIntDiv(tuple_num, tuple_div)

Returns a tuple of the quotients. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleIntDivByNumber(tuple_num, div) staticmethod

tupleIntDivByNumber(tuple_num, div)

Returns a tuple of the quotients. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleIntDivOrZero(tuple_num, tuple_div) staticmethod

tupleIntDivOrZero(tuple_num, tuple_div)

Returns tuple of the quotients. Returns 0 for quotients where the divisor is 0. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleIntDivOrZeroByNumber(tuple_num, div) staticmethod

tupleIntDivOrZeroByNumber(tuple_num, div)

Returns a tuple of the quotients with 0 for quotients where the divisor is 0. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleMinus(t1, t2) staticmethod

tupleMinus(t1, t2)

Returns a tuple containing the results of the subtractions. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleModulo(tuple_num, tuple_mod) staticmethod

tupleModulo(tuple_num, tuple_mod)

Returns tuple of the remainders of division. An error is thrown for division by zero. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleModuloByNumber(tuple_num, div) staticmethod

tupleModuloByNumber(tuple_num, div)

Returns tuple of the remainders of division. An error is thrown for division by zero. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleMultiply(t1, t2) staticmethod

tupleMultiply(t1, t2)

Returns a tuple with the results of the multiplications. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleMultiplyByNumber(tuple, number) staticmethod

tupleMultiplyByNumber(tuple, number)

Returns a tuple with multiplied elements. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleNames(tuple) staticmethod

tupleNames(tuple)

tupleNegate(t) staticmethod

tupleNegate(t)

Returns a tuple with the result of negation. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tuplePlus(t1, t2) staticmethod

tuplePlus(t1, t2)

Returns a tuple containing the sums of corresponding input tuple arguments. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)

tupleToNameValuePairs(tuple) staticmethod

tupleToNameValuePairs(tuple)

Returns an array with (name, value) pairs. Array(Tuple(String, T))

unbin(arg) staticmethod

unbin(arg)

  • arg — A string containing any number of binary digits. String

Returns a binary string (BLOB). String

unhex(arg) staticmethod

unhex(arg)

  • arg — A string containing any number of hexadecimal digits. String or FixedString

Returns a binary string (BLOB). String

uniq(x) staticmethod

uniq(x[, ...])

Returns a UInt64-type number representing the approximate number of different values. UInt64

uniqCombined(HLL_precision) staticmethod

uniqCombined(HLL_precision)(x[, ...]) uniqCombined(x[, ...])

Returns a UInt64-type number representing the approximate number of different argument values. UInt64

uniqCombined64(HLL_precision) staticmethod

uniqCombined64(HLL_precision)(x[, ...]) uniqCombined64(x[, ...])

Returns a UInt64-type number representing the approximate number of different argument values. UInt64

uniqExact(x) staticmethod

uniqExact(x[, ...])

Returns the exact number of different argument values as a UInt64. UInt64

uniqHLL12(x) staticmethod

uniqHLL12(x[, ...])

Returns a UInt64-type number representing the approximate number of different argument values. UInt64

uniqTheta(x) staticmethod

uniqTheta(x[, ...])

Returns a UInt64-type number representing the approximate number of different argument values. UInt64

uniqUpTo(*args) staticmethod

upper(s) staticmethod

upper(s)

  • s — The string to convert to uppercase. String

Returns an uppercase string from s. String

upperUTF8(s) staticmethod

upperUTF8(s)

A String data type value. String

uptime() staticmethod

uptime()

Returns the server uptime in seconds. UInt32

validateNestedArraySizes(*args) staticmethod

varPop(x) staticmethod

varPop(x)

Returns the population variance of x. Float64

varPopStable(x) staticmethod

varPopStable(x)

Returns the population variance of x. Float64

varSamp(x) staticmethod

varSamp(x)

  • x — The population for which you want to calculate the sample variance. (U)Int* or Float* or Decimal*

Returns the sample variance of the input data set x. Float64

varSampStable(x) staticmethod

varSampStable(x)

  • x — The population for which you want to calculate the sample variance. (U)Int* or Float* or Decimal*

Returns the sample variance of the input data set. Float64

variantElement(variant, type_name, default_value=None) staticmethod

variantElement(variant, type_name[, default_value])

  • variant — Variant column. Variant
  • type_name — The name of the variant type to extract. String
  • default_value — The default value that will be used if variant doesn't have variant with specified type. Can be any type. Optional. Any

Returns a column with the specified variant type extracted from the Variant column. Any

variantType(variant) staticmethod

variantType(variant)

  • variant — Variant column. Variant

Returns an Enum column with variant type name for each row. Enum

version() staticmethod

version()

Returns the current version of ClickHouse. String

visibleWidth(x) staticmethod

visibleWidth(x)

  • x — A value of any data type. Any

Returns the approximate width of the value when displayed in text format. UInt64

welchTTest(confidence_level=None) staticmethod

welchTTest([confidence_level])(sample_data, sample_index)

Returns a Tuple with two or four elements (if the optional confidence_level is specified): calculated t-statistic, calculated p-value, and optionally calculated confidence-interval-low and confidence-interval-high. Tuple(Float64, Float64) or Tuple(Float64, Float64, Float64, Float64)

widthBucket(operand, low, high, count) staticmethod

widthBucket(operand, low, high, count)

Returns the bucket number as an integer. Returns 0 if operand < low, returns count+1 if operand >= high. UInt8/16/32/64

windowFunnel(*args) staticmethod

windowID(time_attr, interval, timezone=None) staticmethod

windowID(time_attr, interval[, timezone])

  • time_attr — Date and time. DateTime
  • interval — Window interval in Interval. Interval
  • timezone — Optional. Timezone name. String

Returns the window identifier of the corresponding window. UInt32

wkb(geometry) staticmethod

wkb(geometry)

  • geometry — The input geometry type to convert into WKB.

wkt(geometry) staticmethod

wkt(geometry)

Returns the WKT string representation of the geometry. String

wordShingleMinHash(string, shinglesize=None, hashnum=None) staticmethod

wordShingleMinHash(string[, shinglesize, hashnum])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two hashes — the minimum and the maximum. Tuple(UInt64, UInt64)

wordShingleMinHashArg(string, shinglesize=None, hashnum=None) staticmethod

wordShingleMinHashArg(string[, shinglesize, hashnum])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two tuples with hashnum word shingles each. Tuple(Tuple(String))

wordShingleMinHashArgCaseInsensitive(string, shinglesize=None, hashnum=None) staticmethod

wordShingleMinHashArgCaseInsensitive(string[, shinglesize, hashnum])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two tuples with hashnum word shingles each. Tuple(Tuple(String))

wordShingleMinHashArgCaseInsensitiveUTF8(string, shinglesize=None, hashnum=None) staticmethod

wordShingleMinHashArgCaseInsensitiveUTF8(string[, shinglesize, hashnum])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two tuples with hashnum word shingles each. Tuple(Tuple(String))

wordShingleMinHashArgUTF8(string, shinglesize=None, hashnum=None) staticmethod

wordShingleMinHashArgUTF8(string[, shinglesize, hashnum])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two tuples with hashnum word shingles each. Tuple(Tuple(String))

wordShingleMinHashCaseInsensitive(string, shinglesize=None, hashnum=None) staticmethod

wordShingleMinHashCaseInsensitive(string[, shinglesize, hashnum])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two hashes — the minimum and the maximum. Tuple(UInt64, UInt64)

wordShingleMinHashCaseInsensitiveUTF8(string, shinglesize=None, hashnum=None) staticmethod

wordShingleMinHashCaseInsensitiveUTF8(string[, shinglesize, hashnum])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two hashes — the minimum and the maximum. Tuple(UInt64, UInt64)

wordShingleMinHashUTF8(string, shinglesize=None, hashnum=None) staticmethod

wordShingleMinHashUTF8(string[, shinglesize, hashnum])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8
  • hashnum — Optional. The number of minimum and maximum hashes used to calculate the result, any number from 1 to 25. The default value is 6. UInt8

Returns a tuple with two hashes — the minimum and the maximum. Tuple(UInt64, UInt64)

wordShingleSimHash(string, shinglesize=None) staticmethod

wordShingleSimHash(string[, shinglesize])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8

Returns the computed hash value. UInt64

wordShingleSimHashCaseInsensitive(string, shinglesize=None) staticmethod

wordShingleSimHashCaseInsensitive(string[, shinglesize])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8

Returns the computed hash value. UInt64

wordShingleSimHashCaseInsensitiveUTF8(string, shinglesize=None) staticmethod

wordShingleSimHashCaseInsensitiveUTF8(string[, shinglesize])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8

Returns the computed hash value. UInt64

wordShingleSimHashUTF8(string, shinglesize=None) staticmethod

wordShingleSimHashUTF8(string[, shinglesize])

  • string — String for which to compute the hash. String
  • shinglesize — Optional. The size of a word shingle, any number from 1 to 25. The default value is 3. UInt8

Returns the computed hash value. UInt64

wyHash64(arg) staticmethod

wyHash64(arg)

  • arg — String argument for which to compute the hash. String

Returns the computed 64-bit hash value UInt64

xor(val1, val2) staticmethod

xor(val1, val2[, ...])

Returns: - 1, for two values: if one of the values evaluates to false and other does not - 0, for two values: if both values evaluate to false or to both true - NULL, if at least one of the inputs is NULL. Nullable(UInt8)

xxHash32(arg) staticmethod

xxHash32(arg)

  • arg — Input string to hash. String

Returns the computed 32-bit hash of the input string. UInt32

xxHash64(arg) staticmethod

xxHash64(arg)

  • arg — Input string to hash. String

Returns the computed 64-bit hash of the input string. UInt64

xxh3(expr) staticmethod

xxh3(expr)

  • expr — A list of expressions of any data type. Any

Returns the computed 64-bit xxh3 hash value UInt64

xxh3_128(expr) staticmethod

xxh3_128(expr)

  • expr — A list of expressions of any data type. Any

Returns the computed 128-bit xxh3 hash value UInt128

yesterday() staticmethod

yesterday()

Returns yesterday's date. Date

zookeeperSessionUptime() staticmethod

zookeeperSessionUptime()

Returns the uptime of the current ZooKeeper session in seconds. UInt32