On this page

    All Functions

    Function NameDescription
    ABSComputes the absolute value of a numeric expression.
    ACOSComputes the arcccosine (inverse cosine) of a value in radians
    APPROX_COUNT_DISTINCTReturns the approximate number of rows that contain distinct values in a column. Ignores rows that contain a null value for the column.
    ASCIIReturns the ASCII code for the first character of a string. If the string is empty, 0 is returned.
    ASINComputes the arcsine (inverse sine) of a value in radians
    ATANComputes the Arctangent (inverse Tangent) of a value
    AVGComputes the average of a set of values.
    BINARY_STRINGConverts the input expression to a binary value.
    BIT_ANDReturns the bitwise AND of non-NULL input values.
    BIT_LENGTHGets length of bits of the input expression
    BIT_ORReturns the bitwise OR of non-NULL input values.
    BOOL_ANDComputes the boolean AND of two boolean expressions. Returns TRUE if both expressions evaluate to TRUE. Returns FALSE if one or both expression(s) evaluate(s) to FALSE.
    BOOL_ORComputes the boolean OR of two boolean expressions. Returns TRUE if one or both expressions evaluate to TRUE. Returns FALSE if both expressions evaluate to FALSE.
    BTRIMTrims leading and trailing characters from a string.
    CASEEvaluates a list of conditions and returns the first resulting true expression. If a true expression is not found, will return the ELSE statement, if present, or else will return NULL.
    CASTConverts a value of one data type to another data type. This function behaves similarly to the TO_<data_type> (i.e. TO_TIMESTAMP) functions.
    CBRTComputes the cube root of a numeric expression
    CHARACTER_LENGTHReturns the length of an input string.
    CHAR_LENGTHReturns the character length of the input string
    CHRConverts a Unicode code point into the character that matches the input Unicode character. If an invalid code point is specified, an empty string is returned.
    COALESCEEvaluates the arguments in order and returns the value of the first expression that does not contain NULL.
    CONCATConcatenates two or more strings
    CONVERT_FROMConverts a binary string from the given data type to a Dremio type.
    CONVERT_REPLACEUTF8Converts a binary string to a UTF-8 value and replaces all characters that cannot be converted to UTF-8 with the specified replacement character.
    CONVERT_TIMEZONEConvert timestamp to the specified timezone
    CONVERT_TOConverts a value to a binary string of a supported data type.
    CORRCalculates the covariance of the values expression1 and expression2. The function name must be enclosed in double quotes (“CORR”).
    COSComputes the cosine of a value in radians
    COSHComputes the hyperbolic cosine of a value in radians.
    COTComputes the cotangent of a value in radians.
    COUNTReturns the total number of records for the specified expression.
    COVAR_POPReturns the population covariance for non-NULL pairs across all input values.
    COVAR_SAMPReturns the sample covariance for non-NULL pairs across all input values.
    CUME_DISTReturns the cumulative distribution of the current row with regard to other values within the same window partition.
    CURRENT_DATEReturns the current date of the system.
    CURRENT_DATE_UTCReturns the current date of the system based on the UTC timezone.
    CURRENT_SCHEMAReturns the path/schema in use by the current session.
    CURRENT_TIMEReturns the current time for the system.
    CURRENT_TIMESTAMPReturns the current timestamp for the system.
    DATE_ADDReturns the sum of two expressions of time as another expression of time.
    DATE_DIFFReturns the difference between two expressions of time as another expression of time.
    DATE_PARTReturn subfields such as year or hour from date or timestamp values
    DATE_SUBReturns the difference of two expressions of time as another expression of time.
    DATE_TRUNCTruncates the date or timestamp to the indicated precision.
    DEGREESConverts radians to degrees.
    DENSE_RANKReturns the rank of the current row within its partition and ordering. Rows that are equal will have the same rank.
    EReturns Euler’s number, a constant approximately equal to 2.718281828459045.
    EXPCalculates Euler’s number, e, raised to the power of the specified value.
    EXTRACTExtracts the specified date or time part from the date or timestamp.
    FLATTENExplodes compound values into multiple rows. This function takes a LIST column and produces a lateral view (that is, an inline view that contains correlation referring to other tables that precede it in the FROM clause).
    FLOORReturns the value from the specifed expression rounded to the nearest equal or smaller integer.
    FROM_HEXReturns a binary value for the given hexadecimal string
    GEO_BEYONDReturns whether or not the two points are beyond the distance specified in meters.
    GEO_DISTANCEReturns the distance between two points in meters.
    GEO_NEARBYReturns whether or not the two points are within the distance specified in meters.
    HASHReturns a hash value of the arguments. HASH does not return NULL, even for NULL inputs.
    HLLUses HyperLogLog to return an approximation of the distinct cardinality of the input.
    ILIKETests whether an expression matches a pattern. The comparison is case-insensitive.
    IMAXDIRReturns the name of a subdirectory of a table in HDFS. The subdirectory has the name that ranks highest in case-insensitive alphanumeric order.
    IMINDIRReturns the name of a subdirectory of a table in HDFS. The subdirectory has the name that ranks lowest in case-insensitive alphanumeric order.
    INITCAPReturns the input string with the first letter of each word in uppercase and the subsequent letters in the word are in lowercase).
    IS [NOT] DISTINCT FROMCompares two expressions to determine whether they have the same or different values. NULLs are considered as comparable values.
    ISFALSETests whether the input expression is false. If it is, returns a value of true.
    IS [NOT] NULLDetermines if an expression is NULL or not NULL. Alias for the function ISNULL/ISNOTNULL.
    ISNUMERICDetermines whether an expression is a valid numeric type (DECIMAL, DOUBLE, INT, BIGINT, VARBINARY).
    ISTRUEReturns TRUE if the input expression evaluates to TRUE.
    IS_BIGINTReturns TRUE if the input expression is an big integer value.
    IS_DATEReturns TRUE if the input expression can be cast to a date.
    IS_INTReturns TRUE if the input expression is an integer value.
    IS_MEMBERReturns whether the current user is a member of the specified role.
    IS_UTF8Returns whether an expression is valid UTF-8
    IS_VARCHARReturns TRUE if the input expression is a varchar value.
    LAGReturns the row before the current one in a partition based on the ORDER BY clause without the need for a self-join. If there are no rows, this function returns NULL.
    LAST_QUERY_IDReturns the ID for the most recently executed query in the current session.
    LEADReturns the row after the current one in the same result set without the need for a self-join. If there are no rows, this function returns NULL.
    LEFTReturns the left-most substring. The function name must be enclosed in double quotes ("LEFT").
    LENGTHReturns the length of an input string. If the character encoding isn’t specified, it assumes to UTF8.
    LIKETests whether an expression matches a pattern. The comparison is case-sensitive.
    LOCALTIMEReturns the current time for the system.
    LOCALTIMESTAMPReturns the current timestamp for the system.
    LOCATESearches for the first occurrence of the first argument in the second argument and if found, returns the position the of the first argument in the second argument. The first character in a string is position 1. Returns 0 if the substring isn’t found in the expression.
    LOGReturns the logarithm of the numeric input expression. If no base is specified, the natural log (ln) will be calculated.
    LOG10Returns the log base 10 of the numeric input expression.
    LOWERReturns the input expression with all the characters converted to lowercase.
    LPADLeft pads a string with spaces or specified characters to reach the number of chracters specified as a parameter.
    LSHIFTShifts the bits of the numeric expression to the left.
    LTRIMRemoves leading spaces or characters from a string.
    MAXReturns the maximum value among the non-NULL input expressions.
    MAXDIRReturns the name of a subdirectory of a table in HDFS. The subdirectory has the name that ranks highest in case-sensitive alphanumeric order.
    MEDIANComputes a percentile based on a continuous distribution of the column value
    MINReturns the minimum value among the non-NULL input expressions.
    MINDIRReturns the name of a subdirectory of a table in HDFS. The subdirectory has the name that ranks lowest in case-sensitive alphanumeric order.
    MODReturns the remainder of the input expression divided by the second input expression.
    NDVReturns an approximate distinct value number, similar to COUNT(DISTINCT col). NDV can return results faster than using the combination of COUNT and DISTINCT while using a constant amount of memory, resulting in less memory usage for columns with high cardinality.
    NOWReturns the current timestamp (date and time) in UTC timezone.
    NTILEEqually splits the rows in each partition into ranked parts specified by the integer value and starting from 1. This function requires the ORDER BY clause.
    NULLIFCompares two expressions. If the values in each expression are equal, returns NULL and, if they are not equal, returns the value of the first expression.
    OCTET_LENGTHReturns the length of the string in bytes.
    PERCENTILE_CONTComputes a percentile based on a continuous distribution of the column value
    PERCENTILE_DISCComputes a specific percentile for sorted values in a column
    PERCENT_RANKReturns the relative rank of the current row in the partition based on the ORDER BY clause. The displayed percentage ranges from 0.0 to 1.0.
    PIReturns the value of pi, which is approximately 3.14592654.
    PIVOTConverts a set of data from rows into columns
    POSITIONReturns the position of the first occurrence of a substring within another string
    POWERReturns the result of raising the input value to the specified power.
    QUERY_USERReturns the username of the user that is currently logged in to the system.
    RADIANSConvert a value in degrees to radians
    RANDOMEach call returns a random generated number between 0 and 1 for each row.
    RANKReturns the rank of the current row within its partition and placement order. Rows that are equal have the same rank. However, the count of tied rows is added to the next rank, instead of being incremented by one. The rank value starts at 1 and increases sequentially.
    REGEXP_LIKEReturns true when the specified regular expression matches values in a column. Otherwise, returns false.
    REGEXP_MATCHESReturns true when the specified regular expression matches values in a column. Otherwise, returns false.
    REGEXP_REPLACEFinds strings that match the given regular expression and replaces the strings with the given string.
    REGEXP_SPLITSplits an input string by using a regular expression according to a keyword and an integer value.
    REPEATBuilds a string by repeating the input for the specified number of times
    REPEATSTRRepeats the given string n times.
    REPLACERemoves all occurrences of a specified substring and replaces them with another string.
    REVERSEReverses the order of characters in a string.
    RIGHTReturns the right-most substring. The function name must be enclosed in double quotes (“RIGHT”).
    ROUNDReturns the rounded value for the inputted value. If no scale is specified, the closest whole number is returned.
    ROW_NUMBERReturns the row number for the current row based on the ORDER BY clause within each partition. Rows containing identical values receive different row numbers.
    RPADRight pads a string with spaces or specified characters to reach the number of chracters specified as a parameter.
    RSHIFTShifts the bits of the numeric expression to he right.
    RTRIMRemoves trailing spaces or characters from a string.
    SESSION_USERReturns the username of the user that created the current session.
    SIMILAR_TOTests whether the entire expression matches a pattern.
    SINComputes the sine of a value.
    SINHComputes the hyperbolic sine of the input expression.
    SPLIT_PARTSplits a given string at a specified character and returns the requested part.
    SQRTReturns the square root of the non-negative numeric expression.
    STDDEVReturns the standard deviation of non-NULL values in a column with a numeric data type. If all records inside a group are NULL, returns NULL.
    STDDEV_POPReturns the population standard deviation (square root of variance) of non-NULL values in a column with a numeric data type. If all records inside a group are NULL, returns NULL.
    STDDEV_SAMPReturns the sample standard deviation (square root of sample variance) of non-NULL values in a column with a numeric data type. If all records inside a group are NULL, returns NULL.
    STRPOSSearches for the first occurence of the substring in the given expression and returns the position of where the substring begins. Searching binary values is also supported.
    SUBSTRINGReturns the portion of the string from the specified base expression starting at the specified chracters.
    SUMReturns the sum of non-NULL input expressions.
    TANComputes the tangent of a value in radians.
    TANHComputes the hyperbolic tangent of the input expression.
    TIMESTAMPADDAdd (or subtract) an interval of time from a date/timestamp value or column
    TIMESTAMPDIFFReturn the amount of time between two date or timestamp values
    TOASCIIConverts a string that is encoded in the specified character set to UTF-8.
    TO_CHARConverts the input expression to a character/string using the specified format.
    TO_DATEConverts the input expressions to the corresponding date.
    TO_HEXReturns a hexadecimal string for the given binary value.
    TO_NUMBERConverts a string into a number (double) in the specified format.
    TO_TIMEConverts the input expressions to the corresponding time.
    TO_TIMESTAMPConverts the input expressions to the corresponding timestamp.
    TRANSACTION_TIMESTAMPReturns the timestamp in UTC of the current transaction.
    TRIMRemoves leading, trailing, or both spaces or characters from a string
    TRUNCATERounds the input expression down the nearest of equal integer depending on the specified number of places before or after the decimal point.
    TYPEOFReports the type (in string format) of the input expression.
    UNIX_TIMESTAMPReturns the Unix timestamp for the timestamp parameter.
    UNPIVOTConverts a set of data from columns into rows
    UPPERReturns the input expression with all the characters converted to uppercase.
    USERReturns the user that is currently logged into the system.
    VAR_POPReturns the population variance of non-NULL records.
    VAR_SAMPReturns the sample variance of non-NULL records.
    XORReturns the bitwise XOR of two integers.