Functions (alphabetical)

This topic contains all functions supported by GoogleSQL for SecOps.

Function list

Name Summary
ABS Computes the absolute value of X.
ACOS Computes the inverse cosine of X.
ACOSH Computes the inverse hyperbolic cosine of X.
ANY_VALUE Gets an expression for some row.
APPROX_COUNT_DISTINCT Gets the approximate result for COUNT(DISTINCT expression).
ARRAY Produces an array with one element for each row in a subquery.
ARRAY_AGG Gets an array of values.
ARRAY_CONCAT Concatenates one or more arrays with the same element type into a single array.
ARRAY_CONCAT_AGG Concatenates arrays and returns a single array as a result.
ARRAY_FIRST Gets the first element in an array.
ARRAY_LAST Gets the last element in an array.
ARRAY_LENGTH Gets the number of elements in an array.
ARRAY_REVERSE Reverses the order of elements in an array.
ARRAY_TO_STRING Produces a concatenation of the elements in an array as a STRING value.
ASIN Computes the inverse sine of X.
ASINH Computes the inverse hyperbolic sine of X.
ATAN Computes the inverse tangent of X.
ATAN2 Computes the inverse tangent of X/Y, using the signs of X and Y to determine the quadrant.
ATANH Computes the inverse hyperbolic tangent of X.
AVG Gets the average of non-NULL values.
BIT_AND Performs a bitwise AND operation on an expression.
BIT_OR Performs a bitwise OR operation on an expression.
BIT_XOR Performs a bitwise XOR operation on an expression.
BYTE_LENGTH Gets the number of BYTES in a STRING or BYTES value.
CAST Convert the results of an expression to the given type.
CBRT Computes the cube root of X.
CEIL Gets the smallest integral value that isn't less than X.
CEILING Synonym of CEIL.
CHAR_LENGTH Gets the number of characters in a STRING value.
CHARACTER_LENGTH Synonym for CHAR_LENGTH.
CODE_POINTS_TO_BYTES Converts an array of extended ASCII code points to a BYTES value.
CODE_POINTS_TO_STRING Converts an array of extended ASCII code points to a STRING value.
CONCAT Concatenates one or more STRING or BYTES values into a single result.
COS Computes the cosine of X.
COSH Computes the hyperbolic cosine of X.
COUNT Gets the number of rows in the input, or the number of rows with an expression evaluated to any value other than NULL.
COUNTIF Gets the number of TRUE values for an expression.
CUME_DIST Gets the cumulative distribution (relative position (0,1]) of each row within a window.
CURRENT_DATE Returns the current date as a DATE value.
CURRENT_DATETIME Returns the current date and time as a DATETIME value.
CURRENT_TIME Returns the current time as a TIME value.
CURRENT_TIMESTAMP Returns the current date and time as a TIMESTAMP object.
DATE Constructs a DATE value.
DATE_ADD Adds a specified time interval to a DATE value.
DATE_DIFF Gets the number of unit boundaries between two DATE values at a particular time granularity.
DATE_FROM_UNIX_DATE Interprets an INT64 expression as the number of days since 1970-01-01.
DATE_SUB Subtracts a specified time interval from a DATE value.
DATE_TRUNC Truncates a DATE value at a particular granularity.
DATETIME Constructs a DATETIME value.
DATETIME_ADD Adds a specified time interval to a DATETIME value.
DATETIME_DIFF Gets the number of unit boundaries between two DATETIME values at a particular time granularity.
DATETIME_SUB Subtracts a specified time interval from a DATETIME value.
DATETIME_TRUNC Truncates a DATETIME value at a particular granularity.
DENSE_RANK Gets the dense rank (1-based, no gaps) of each row within a window.
DIV Divides integer X by integer Y.
ENDS_WITH Checks if a STRING or BYTES value is the suffix of another value.
EXP Computes e to the power of X.
EXTRACT Extracts part of a date from a DATE value.
EXTRACT Extracts part of a date and time from a DATETIME value.
EXTRACT Extracts part of a TIME value.
EXTRACT Extracts part of a TIMESTAMP value.
FARM_FINGERPRINT Computes the fingerprint of a STRING or BYTES value, using the FarmHash Fingerprint64 algorithm.
FIRST_VALUE Gets a value for the first row in the current window frame.
FLOOR Gets the largest integral value that isn't greater than X.
FORMAT_DATE Formats a DATE value according to a specified format string.
FORMAT_DATETIME Formats a DATETIME value according to a specified format string.
FORMAT_TIME Formats a TIME value according to the specified format string.
FORMAT_TIMESTAMP Formats a TIMESTAMP value according to the specified format string.
FORMAT Formats data and produces the results as a STRING value.
FROM_BASE32 Converts a base32-encoded STRING value into a BYTES value.
FROM_BASE64 Converts a base64-encoded STRING value into a BYTES value.
GENERATE_ARRAY Generates an array of values in a range.
GENERATE_DATE_ARRAY Generates an array of dates in a range.
GREATEST Gets the greatest value among X1,...,XN.
HLL_COUNT.EXTRACT Extracts a cardinality estimate of an HLL++ sketch.
HLL_COUNT.INIT Aggregates values of the same underlying type into a new HLL++ sketch.
HLL_COUNT.MERGE Merges HLL++ sketches of the same underlying type into a new sketch, and then gets the cardinality of the new sketch.
HLL_COUNT.MERGE_PARTIAL Merges HLL++ sketches of the same underlying type into a new sketch.
IEEE_DIVIDE Divides X by Y, but doesn't generate errors for division by zero or overflow.
INITCAP Formats a STRING as proper case, which means that the first character in each word is uppercase and all other characters are lowercase.
INSTR Finds the position of a subvalue inside another value, optionally starting the search at a given offset or occurrence.
IS_INF Checks if X is positive or negative infinity.
IS_NAN Checks if X is a NaN value.
JSON_EXTRACT_ARRAY (Deprecated) Extracts a JSON array and converts it to a SQL ARRAY<JSON-formatted STRING> value.
JSON_EXTRACT_STRING_ARRAY (Deprecated) Extracts a JSON array of scalar values and converts it to a SQL ARRAY<STRING> value.
JSON_FLATTEN Produces a new SQL ARRAY<JSON> value containing all non-array values that are either directly in the input JSON value or children of one or more consecutively nested arrays in the input JSON value.
JSON_QUERY_ARRAY Extracts a JSON array and converts it to a SQL ARRAY<JSON-formatted STRING> value.
JSON_TYPE Gets the JSON type of the outermost JSON value and converts the name of this type to a SQL STRING value.
JSON_VALUE_ARRAY Extracts a JSON array of scalar values and converts it to a SQL ARRAY<STRING> value.
KEYS.KEYSET_LENGTH Gets the number of keys in the provided keyset.
KEYS.NEW_WRAPPED_KEYSET Creates a new keyset and encrypts it with a TODO: Add KMS name short variable key.
KEYS.REWRAP_KEYSET Re-encrypts a wrapped keyset with a new TODO: Add KMS name short variable key.
KEYS.ROTATE_WRAPPED_KEYSET Rewraps a keyset and rotates it.
LAG Gets a value for a preceding row.
LAST_VALUE Gets a value for the last row in the current window frame.
LEAD Gets a value for a subsequent row.
LEAST Gets the least value among X1,...,XN.
LENGTH Gets the length of a STRING or BYTES value.
LN Computes the natural logarithm of X.
LOG Computes the natural logarithm of X or the logarithm of X to base Y.
LOG10 Computes the natural logarithm of X to base 10.
LOGICAL_AND Gets the logical AND of all non-NULL expressions.
LOGICAL_OR Gets the logical OR of all non-NULL expressions.
LOWER Formats alphabetic characters in a STRING value as lowercase.

Formats ASCII characters in a BYTES value as lowercase.
LPAD Prepends a STRING or BYTES value with a pattern.
LTRIM Identical to the TRIM function, but only removes leading characters.
MAX Gets the maximum non-NULL value.
MD5 Computes the hash of a STRING or BYTES value, using the MD5 algorithm.
MIN Gets the minimum non-NULL value.
MOD Gets the remainder of the division of X by Y.
NET.HOST Gets the hostname from a URL.
NET.IP_FROM_STRING Converts an IPv4 or IPv6 address from a STRING value to a BYTES value in network byte order.
NET.IP_NET_MASK Gets a network mask.
NET.IP_TO_STRING Converts an IPv4 or IPv6 address from a BYTES value in network byte order to a STRING value.
NET.IP_TRUNC Converts a BYTES IPv4 or IPv6 address in network byte order to a BYTES subnet address.
NET.IPV4_FROM_INT64 Converts an IPv4 address from an INT64 value to a BYTES value in network byte order.
NET.IPV4_TO_INT64 Converts an IPv4 address from a BYTES value in network byte order to an INT64 value.
NET.PUBLIC_SUFFIX Gets the public suffix from a URL.
NET.REG_DOMAIN Gets the registered or registrable domain from a URL.
NET.SAFE_IP_FROM_STRING Similar to the NET.IP_FROM_STRING, but returns NULL instead of producing an error if the input is invalid.
NORMALIZE Case-sensitively normalizes the characters in a STRING value.
NORMALIZE_AND_CASEFOLD Case-insensitively normalizes the characters in a STRING value.
NTH_VALUE Gets a value for the Nth row of the current window frame.
NTILE Gets the quantile bucket number (1-based) of each row within a window.
PARSE_DATE Converts a STRING value to a DATE value.
PARSE_DATETIME Converts a STRING value to a DATETIME value.
PARSE_TIME Converts a STRING value to a TIME value.
PARSE_TIMESTAMP Converts a STRING value to a TIMESTAMP value.
PERCENT_RANK Gets the percentile rank (from 0 to 1) of each row within a window.
POW Produces the value of X raised to the power of Y.
POWER Synonym of POW.
RAND Generates a pseudo-random value of type FLOAT64 in the range of [0, 1).
RANGE_BUCKET Scans through a sorted array and returns the 0-based position of a point's upper bound.
RANK Gets the rank (1-based) of each row within a window.
REGEXP_CONTAINS Checks if a value is a partial match for a regular expression.
REGEXP_EXTRACT Produces a substring that matches a regular expression.
REGEXP_EXTRACT_ALL Produces an array of all substrings that match a regular expression.
REGEXP_INSTR Finds the position of a regular expression match in a value, optionally starting the search at a given offset or occurrence.
REGEXP_REPLACE Produces a STRING value where all substrings that match a regular expression are replaced with a specified value.
REPEAT Produces a STRING or BYTES value that consists of an original value, repeated.
REPLACE Replaces all occurrences of a pattern with another pattern in a STRING or BYTES value.
REVERSE Reverses a STRING or BYTES value.
ROUND Rounds X to the nearest integer or rounds X to N decimal places after the decimal point.
ROW_NUMBER Gets the sequential row number (1-based) of each row within a window.
RPAD Appends a STRING or BYTES value with a pattern.
RTRIM Identical to the TRIM function, but only removes trailing characters.
SHA1 Computes the hash of a STRING or BYTES value, using the SHA-1 algorithm.
SHA256 Computes the hash of a STRING or BYTES value, using the SHA-256 algorithm.
SHA512 Computes the hash of a STRING or BYTES value, using the SHA-512 algorithm.
SIGN Produces -1 , 0, or +1 for negative, zero, and positive arguments respectively.
SIN Computes the sine of X.
SINH Computes the hyperbolic sine of X.
SPLIT Splits a STRING or BYTES value, using a delimiter.
SQRT Computes the square root of X.
STARTS_WITH Checks if a STRING or BYTES value is a prefix of another value.
STDDEV An alias of the STDDEV_SAMP function.
STDDEV_POP Computes the population (biased) standard deviation of the values.
STDDEV_SAMP Computes the sample (unbiased) standard deviation of the values.
STRING (Timestamp) Converts a TIMESTAMP value to a STRING value.
STRING_AGG Concatenates non-NULL STRING or BYTES values.
STRPOS Finds the position of the first occurrence of a subvalue inside another value.
SUBSTR Gets a portion of a STRING or BYTES value.
SUM Gets the sum of non-NULL values.
TAN Computes the tangent of X.
TANH Computes the hyperbolic tangent of X.
TIME Constructs a TIME value.
TIME_ADD Adds a specified time interval to a TIME value.
TIME_DIFF Gets the number of unit boundaries between two TIME values at a particular time granularity.
TIME_SUB Subtracts a specified time interval from a TIME value.
TIME_TRUNC Truncates a TIME value at a particular granularity.
TIMESTAMP Constructs a TIMESTAMP value.
TIMESTAMP_ADD Adds a specified time interval to a TIMESTAMP value.
TIMESTAMP_DIFF Gets the number of unit boundaries between two TIMESTAMP values at a particular time granularity.
TIMESTAMP_MICROS Converts the number of microseconds since 1970-01-01 00:00:00 UTC to a TIMESTAMP.
TIMESTAMP_MILLIS Converts the number of milliseconds since 1970-01-01 00:00:00 UTC to a TIMESTAMP.
TIMESTAMP_SECONDS Converts the number of seconds since 1970-01-01 00:00:00 UTC to a TIMESTAMP.
TIMESTAMP_SUB Subtracts a specified time interval from a TIMESTAMP value.
TIMESTAMP_TRUNC Truncates a TIMESTAMP value at a particular granularity.
TO_BASE32 Converts a BYTES value to a base32-encoded STRING value.
TO_BASE64 Converts a BYTES value to a base64-encoded STRING value.
TO_CODE_POINTS Converts a STRING or BYTES value into an array of extended ASCII code points.
TO_JSON_STRING Converts a SQL value to a JSON-formatted STRING value.
TRIM Removes the specified leading and trailing Unicode code points or bytes from a STRING or BYTES value.
TRUNC Rounds a number like ROUND(X) or ROUND(X, N), but always rounds towards zero and never overflows.
TYPEOF Gets the name of the data type for an expression.
UNICODE Gets the Unicode code point for the first character in a value.
UNIX_DATE Converts a DATE value to the number of days since 1970-01-01.
UNIX_MICROS Converts a TIMESTAMP value to the number of microseconds since 1970-01-01 00:00:00 UTC.
UNIX_MILLIS Converts a TIMESTAMP value to the number of milliseconds since 1970-01-01 00:00:00 UTC.
UNIX_SECONDS Converts a TIMESTAMP value to the number of seconds since 1970-01-01 00:00:00 UTC.
UPPER Formats alphabetic characters in a STRING value as uppercase.

Formats ASCII characters in a BYTES value as uppercase.
VAR_POP Computes the population (biased) variance of the values.
VAR_SAMP Computes the sample (unbiased) variance of the values.
VARIANCE An alias of VAR_SAMP.
VECTOR_SEARCH Performs a semantic search on embeddings to find similar entities.