The documentation below is generated from the
system.functions system table.dotProduct
Introduced in: v21.11.0 Calculates the dot product (scalar product) of two vectors (tuples or arrays of equal size). Returns the sum of the products of the corresponding elements. SyntaxscalarProduct
Arguments
vector1— First vector.Array(T)orTuple(T)vector2— Second vector. Must be the same size as the first vector.Array(T)orTuple(T)
(U)Int* or Float* or Decimal
Examples
Basic usage
Query
Response
flattenTuple
Introduced in: v22.6.0 Flattens a named and nested tuple. The elements of the returned tuple are the paths of the input tuple. Syntaxinput— Named and nested tuple to flatten.Tuple(n1 T1[, n2 T2, ... ])
Tuple(T)
Examples
Usage example
Query
Response
tuple
Introduced in: v1.1.0 Returns a tuple by grouping input arguments. For columns C1, C2, … with the types T1, T2, …, it returns a named Tuple(C1 T1, C2 T2, …) type tuple containing these columns if their names are unique and can be treated as unquoted identifiers, otherwise a Tuple(T1, T2, …) is returned. There is no cost to execute the function. Tuples are normally used as intermediate values for an argument of IN operators, or for creating a list of formal parameters of lambda functions. Tuples can’t be written to a table. The function implements the operator(x, y, ...).
Syntax
- None.
Query
Response
tupleConcat
Introduced in: v23.8.0 Combines tuples passed as arguments. SyntaxtupleN— Arbitrary number of arguments of Tuple type.Tuple(T)
Tuple(T)
Examples
Usage example
Query
Response
tupleDivide
Introduced in: v21.11.0 Calculates the element-wise division of two or more tuples of the same size, applied left-to-right.Division by zero will return
inf.t1— First input tuple.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)t2, ..., tN— One or more further input tuples. All tuples must have the same size.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Two tuples
Query
Response
Query
Response
tupleDivideByNumber
Introduced in: v21.11.0 Returns a tuple with all elements divided by a number.Division by zero will return
inf.tuple— Tuple to divide.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)number— Divider.(U)Int*orFloat*orDecimal
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Basic usage
Query
Response
tupleElement
Introduced in: v1.1.0 Extracts an element from a tuple by index or name. For access by index, an 1-based numeric index is expected. For access by name, the element name can be provided as a string (works only for named tuples). Negative indexes are supported. In this case, the corresponding element is selected, numbered from the end. For example,tuple.-1 is the last element in the tuple.
An optional third argument specifies a default value which is returned instead of throwing an exception when the accessed element does not exist.
All arguments must be constants.
This function has zero runtime cost and implements the operators x.index and x.name.
Syntax
tuple— A tuple or array of tuples.Tuple(T)orArray(Tuple(T))index— Column index, starting from 1.const UInt8/16/32/64name— Name of the element.const Stringdefault_value— Default value returned when index is out of bounds or element doesn’t exist.Any
Any
Examples
Index access
Query
Response
Query
Response
Query
Response
Query
Response
Query
Response
tupleHammingDistance
Introduced in: v21.1.0 Returns the Hamming Distance between two tuples of the same size.The result type is determined the same way it is for Arithmetic functions, based on the number of elements in the input tuples.
UInt8/16/32/64
Examples
Usage example
Query
Response
Query
Response
tupleIntDiv
Introduced in: v23.8.0 Performs element-wise integer division of two or more tuples of the same size, applied left-to-right. Returns a tuple of quotients. If any tuple contains non-integer elements, the result is calculated by rounding to the nearest integer for each non-integer numerator or divisor. Division by 0 causes an exception to be thrown. Syntaxt1— First input tuple.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)t2, ..., tN— One or more further input tuples. All tuples must have the same size.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Two tuples
Query
Response
Query
Response
Query
Response
tupleIntDivByNumber
Introduced in: v23.8.0 Performs integer division of a tuple of numerators by a given denominator, and returns a tuple of the quotients. If either of the input parameters contain non-integer elements then the result is calculated by rounding to the nearest integer for each non-integer numerator or divisor. An error will be thrown for division by 0. Syntaxtuple_num— Tuple of numerator values.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)div— The divisor value.(U)Int*orFloat*orDecimal
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Basic usage
Query
Response
Query
Response
tupleIntDivOrZero
Introduced in: v23.8.0 LiketupleIntDiv, performs element-wise integer division of two or more tuples of the same size, applied left-to-right.
In case of division by 0, returns 0 for that element instead of throwing an exception.
If any tuple contains non-integer elements, the result is calculated by rounding to the nearest integer for each non-integer numerator or divisor.
Syntax
t1— First input tuple.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)t2, ..., tN— One or more further input tuples. All tuples must have the same size.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
With zero divisors
Query
Response
Query
Response
tupleIntDivOrZeroByNumber
Introduced in: v23.8.0 LiketupleIntDivByNumber it does integer division of a tuple of numerators by a given denominator, and returns a tuple of the quotients.
It does not throw an error for zero divisors, but rather returns the quotient as zero.
If either the tuple or div contain non-integer elements then the result is calculated by rounding to the nearest integer for each non-integer numerator or divisor.
Syntax
tuple_num— Tuple of numerator values.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)div— The divisor value.(U)Int*orFloat*orDecimal
0 for quotients where the divisor is 0. Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Basic usage
Query
Response
Query
Response
tupleMinus
Introduced in: v21.11.0 Calculates the element-wise difference of two or more tuples of the same size, applied left-to-right. SyntaxvectorDifference
Arguments
t1— First input tuple.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)t2, ..., tN— One or more further input tuples. All tuples must have the same size.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Two tuples
Query
Response
Query
Response
tupleModulo
Introduced in: v23.8.0 Returns a tuple of element-wise remainders from dividing two or more tuples of the same size, applied left-to-right. Syntaxt1— First input tuple.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)t2, ..., tN— One or more further input tuples. All tuples must have the same size.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Two tuples
Query
Response
Query
Response
tupleModuloByNumber
Introduced in: v23.8.0 Returns a tuple of the moduli (remainders) of division operations of a tuple and a given divisor. Syntaxtuple_num— Tuple of numerator elements.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)div— The divisor value.(U)Int*orFloat*orDecimal
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Basic usage
Query
Response
tupleMultiply
Introduced in: v21.11.0 Calculates the element-wise product of two or more tuples of the same size. Syntaxt1— First input tuple.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)t2, ..., tN— One or more further input tuples. All tuples must have the same size.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Two tuples
Query
Response
Query
Response
tupleMultiplyByNumber
Introduced in: v21.11.0 Returns a tuple with all elements multiplied by a number. Syntaxtuple— Tuple to multiply.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)number— Multiplier.(U)Int*orFloat*orDecimal
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Basic usage
Query
Response
tupleNames
Introduced in: v24.8.0 Converts a tuple into an array of column names. For a tuple in the formTuple(a T, b T, ...), it returns an array of strings representing the named columns of the tuple. If the tuple elements do not have explicit names, their indices will be used as the column names instead.
Syntax
- None.
Query
Response
tupleNegate
Introduced in: v21.11.0 Calculates the negation of the tuple elements. Syntaxt— Tuple to negate.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Basic usage
Query
Response
tuplePlus
Introduced in: v21.11.0 Calculates the element-wise sum of two or more tuples of the same size. SyntaxvectorSum
Arguments
t1— First input tuple.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)t2, ..., tN— One or more further input tuples. All tuples must have the same size.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Two tuples
Query
Response
Query
Response
tuplePositiveModuloByNumber
Introduced in: v26.4.0 Returns a tuple of the positive moduli (remainders) of division operations of a tuple and a given divisor. Unlike tupleModuloByNumber, the result is always non-negative. Syntaxtuple_num— Tuple of numerator values.Tuple((U)Int*)orTuple(Float*)orTuple(Decimal)div— The divisor value.(U)Int*orFloat*orDecimal
Tuple((U)Int*) or Tuple(Float*) or Tuple(Decimal)
Examples
Basic usage
Query
Response
tupleToNameValuePairs
Introduced in: v21.9.0 Converts a tuple to an array of(name, value) pairs.
For example, tuple Tuple(n1 T1, n2 T2, ...) is converted to Array(Tuple('n1', T1), Tuple('n2', T2), ...).
All values in the tuple must be of the same type.
Syntax
tuple— Named tuple with any types of values.Tuple(n1 T1[, n2 T2, ...])
(name, value) pairs. Array(Tuple(String, T))
Examples
Named tuple
Query
Response
Query
Response
untuple
Performs syntactic substitution of tuple elements in the call location. The names of the result columns are implementation-specific and subject to change. Do not assume specific column names afteruntuple.
Syntax
EXCEPT expression to skip columns as a result of the query.
Arguments
x— Atuplefunction, column, or tuple of elements. Tuple.
- None.
Tuple-type column as the untuple function parameter:
Query
Response
EXCEPT expression:
Query
Response