DQL Functions

DQL functions grouped by category. For in-depth information on a specific function, select its name.

Aggregation functions

Aggregation functions compute results from a list of records.

Name

Description

Calculates the average value of a field for a list of records.

Collects the values of the provided field into an array.

Collects distinct values of the provided field into an array.

Calculates the Pearson correlation of two numeric fields for a list of records.

Counts the total number of records.

Calculates the cardinality of unique values of a field for a list of records.

Calculates the cardinality of unique values of a field for a list of records based on a stochastic estimation.

String functions

String functions allow you to create expressions that manipulate text strings in a variety of ways.

Name

Description

Concatenates the expressions into a single string.

Searches the string expression for a substring.

Returns a URL-decoded string.

Encodes a URL string.

Checks if a string expression ends with a suffix.

Returns an escaped string.

Returns the character at a given position from a string expression.

Conversion and casting functions

Conversion and casting functions convert the expression or value from one data type to another type.

Name

Description

Returns array value if the value is array, otherwise, returns null.

Returns binary value (byte array) if the value is binary, otherwise, returns null.

Returns boolean value if the value is boolean, otherwise, returns null.

Returns double value if the value is double, otherwise, returns null.

Returns duration value if the value is duration, otherwise, returns null.

You can use this function to cast to an IP address.

Returns long value if the value is long, otherwise, null.

Conditional functions

Functions that return a conditional result.

Name

Description

Returns the first non-null argument, if any, otherwise null.

Evaluates the condition, and returns the value of either the then or else parameter.

Boolean functions

Functions that evaluate boolean expressions and test the presence of values.

Name

Description

Evaluates if an expression is false or null.

Tests if a value is not null.

Tests if a value is null.

Evaluates if an expression is true or null.

Time functions

Time functions return the decimal number for a particular time value, calculate the number of time units (days, months, years) between two dates, and allow to determine timestamps and timeframes, among others.

Name

Description

Creates a duration from the given amount and time unit.

Formats a given timestamp according to a format string using a given pattern.

Extracts the day of the month from a timestamp.

Extracts the day of the week from a timestamp.

Extracts the day of the year from a timestamp.

Extracts the end timestamp from a timeframe.

Extracts the hour from a timestamp.

Array functions

Functions related to a collection of items of the same data type stored at adjacent memory locations.

Name

Description

Creates an array from the list of given parameters.

Returns the average of an array.

Concatenates multiple arrays into a single array.

Returns the cumulative sum, also known as the running total, of the elements of the input array.

Returns an array where each element is the difference from the previous non-null element.

Returns the array without duplicates.

Returns the first non-null element of an array.

Vector distance functions

Functions that calculate the distance between numeric array expressions.

Name

Description

Calculates the taxicab distance between numeric array expressions.

Calculates the Euclidean distance between numeric array expressions.

Calculates the cosine distance between numeric array expressions.

Calculates the negative dot product between numeric array expressions.

Network functions

Functions related to IP addresses.

Name

Description

You can use this function to create an IP address.

This function can be used to check if a list of IP addresses or an IP network (e.g. 127.0.0.1/8) contains particular IP addresses

Checks if an IP address is a link-local IP address.

Checks if an IP address is a loopback IP address.

Checks if an IP address is a private IP address.

Checks if an IP address is a public IP address.

You can use this function to mask an IP address with given bits.

Cryptographic functions

Hash related functions.

Name

Description

Returns a CRC32 hash for a given string expression.

Computes the MD5 hash for a given string expression.

Computes the SHA-1 hash for a given string expression.

Returns a SHA-256 hash for the given expression.

Returns a SHA-512 hash for the given expression.

Returns a xxHash32 hash for a given string expression.

Returns a xxHash32 hash for a given string expression.

Bitwise functions

Bitwise operations performing on long expressions.

Name

Description

Calculates the bitwise and between two long expressions.

Counts the bits assigned to one of the long expressions.

Inverts the bits included in the long expression.

Shifts the long expressions by the number of given bits to the left.

Shifts the long expression by number of given bits to the right.

Calculates the bitwise or between two long expressions.

Calculates the bitwise xor between two long expressions.

Mathematical functions

Functions executing mathematical calculations.

Name

Description

Returns the absolute value of numeric_expression.

Computes arc cosine of expression.

Computes arc sine of expression.

Computes the arc tangent of expression.

Computes the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta).

Rounds values down to a multiple of a given numeric bin size.

Calculates the smallest (closest to negative infinity) double value greater than or equal to the numeric_expression; is equal to a mathematical integer.

Join functions

Functions that join records from subqueries.

Name

Description

Returns a record from a subquery (the lookup table) producing a match between a field in the source table (sourceField) and a field in the lookup table (lookupField).

General functions

Functions with a general purpose.

Name

Description

Returns entities matching the specified entity selector.

Returns the attribute value for an entity.

Returns the name of an entity.

Tests if a field exists.

Tests if a value is a member of an array.

Creates a record from the keys and values of the parameter.