Expressions#
Expressions#
|
Creates an expression which refers to a table's column. |
|
Creates a SQL literal. |
|
Indicates a range from 'start' to 'end', which can be used in columns selection. |
|
Boolean AND in three-valued logic. |
|
Boolean OR in three-valued logic. |
|
Inverts a given boolean expression. |
Returns the current database |
|
Returns the current SQL date in local time zone. |
|
Returns the current SQL time in local time zone. |
|
Returns the current SQL timestamp in local time zone, the return type of this expression is TIMESTAMP_LTZ. |
|
|
Returns the current watermark for the given rowtime attribute, or NULL if no common watermark of all upstream operations is available at the current operation in the pipeline. |
Returns the current SQL time in local time zone. |
|
Returns the current SQL timestamp in local time zone, the return type of this expression s TIMESTAMP. |
|
|
Converts a numeric type epoch time to TIMESTAMP_LTZ. |
|
Determines whether two anchored time intervals overlap. |
|
Formats a timestamp as a string using a specified format. |
|
Returns the (signed) number of |
|
Convert unix timestamp (seconds since '1970-01-01 00:00:00' UTC) to datetime string the given format. |
|
Creates an array of literals. |
|
Creates a row of expressions. |
|
Creates a map of expressions. |
|
Creates an interval of rows. |
|
Returns a value that is closer than any other value to pi. |
|
Returns a value that is closer than any other value to e. |
|
Returns a pseudorandom double value between 0.0 (inclusive) and 1.0 (exclusive) with a initial seed if specified. |
|
Returns a pseudorandom integer value between 0 (inclusive) and the specified value (exclusive) with a initial seed if specified. |
|
Calculates the arc tangent of a given coordinate. |
|
Returns negative numeric. |
|
Returns the string that results from concatenating the arguments. |
|
Returns the string that results from concatenating the arguments and separator. |
|
Returns an UUID (Universally Unique Identifier) string (e.g., "3d3c68f7-f608-473f-b60c-b0c44ad4cc4e") according to RFC 4122 type 4 (pseudo randomly generated) UUID. |
|
Returns a null literal value of a given data type. |
|
If base is specified, calculates the logarithm of the given value to the given base. |
Source watermark declaration for schema. |
|
|
Ternary conditional operator that decides which of two other expressions should be evaluated based on a evaluated boolean condition. |
|
Returns the first argument that is not NULL. |
|
Creates an expression that selects a range of columns. |
|
Creates an expression that selects all columns except for the given range of columns. |
|
Serializes a value into JSON. |
|
Builds a JSON object string from a list of key-value pairs. |
|
Builds a JSON object string by aggregating key-value expressions into a single JSON object. |
|
Builds a JSON array string from a list of values. |
|
Builds a JSON object string by aggregating items into an array. |
|
The first parameter f could be a str or a Python user-defined function. |
|
A call to a SQL expression. |
Expression#
arithmetic functions#
Calculates the Euler's number raised to the given power. |
|
Calculates the base 10 logarithm of the given value. |
|
Calculates the base 2 logarithm of the given value. |
|
Calculates the natural logarithm of the given value. |
|
|
Calculates the natural logarithm of the given value if base is not specified. |
Calculates the hyperbolic cosine of a given number. |
|
Calculates the hyperbolic sine of a given number. |
|
Calculates the sine of a given number. |
|
Calculates the cosine of a given number. |
|
Calculates the tangent of a given number. |
|
Calculates the cotangent of a given number. |
|
Calculates the arc sine of a given number. |
|
Calculates the arc cosine of a given number. |
|
Calculates the arc tangent of a given number. |
|
Calculates the hyperbolic tangent of a given number. |
|
Converts numeric from radians to degrees. |
|
Converts numeric from degrees to radians. |
|
Calculates the square root of a given value. |
|
Calculates the absolute value of given value. |
|
Calculates the signum of a given number. |
|
|
Rounds the given number to integer places right to the decimal point. |
|
Returns true if the given expression is between lower_bound and upper_bound (both inclusive). |
|
Returns true if the given expression is not between lower_bound and upper_bound (both inclusive). |
|
Ternary conditional operator that decides which of two other expressions should be evaluated based on a evaluated boolean condition. |
|
Returns null_replacement if the given expression is null; otherwise the expression is returned. |
Returns true if the given expression is null. |
|
Returns true if the given expression is not null. |
|
Returns true if given boolean expression is true. |
|
Returns true if given boolean expression is false. |
|
Returns true if given boolean expression is not true (for null and false). |
|
Returns true if given boolean expression is not false (for null and true). |
|
Similar to a SQL distinct aggregation clause such as COUNT(DISTINCT a), declares that an aggregation function is only applied on distinct input values. |
|
Returns the sum of the numeric field across all input values. |
|
Returns the sum of the numeric field across all input values. |
|
Returns the minimum value of field across all input values. |
|
Returns the maximum value of field across all input values. |
|
Returns the number of input rows for which the field is not null. |
|
Returns the average (arithmetic mean) of the numeric field across all input values. |
|
Returns the first value of field across all input values. |
|
Returns the last value of field across all input values. |
|
Returns the population standard deviation of an expression(the square root of var_pop). |
|
Returns the sample standard deviation of an expression(the square root of var_samp). |
|
Returns the population standard variance of an expression. |
|
Returns the sample variance of a given expression. |
|
Returns multiset aggregate of a given expression. |
|
|
Specifies a name for an expression i.e. a field. |
|
Returns a new value being cast to type type. |
|
Like cast, but in case of error, returns NULL rather than failing the job. |
Specifies ascending order of an expression i.e. a field for order_by. |
|
Specifies descending order of an expression i.e. a field for order_by. |
|
|
If first_element_or_table is a Table, Returns true if an expression exists in a given table sub-query. |
Returns the start time (inclusive) of a window when applied on a window reference. |
|
Returns the end time (exclusive) of a window when applied on a window reference. |
|
Returns a string representation of an integer numeric value in binary format. |
|
Returns a string representation of an integer numeric value or a string in hex format. |
|
|
Returns a number of truncated to n decimal places. |
string functions#
|
Creates a substring of the given string at given index for a given length. |
|
Creates a substring of the given string at given index for a given length. |
|
Removes leading space characters from the given string if character is None. |
|
Removes trailing space characters from the given string if character is None. |
|
Removes leading and trailing space characters from the given string if character is None. |
|
Returns a new string which replaces all the occurrences of the search target with the replacement string (non-overlapping). |
Returns the length of a string. |
|
Returns all of the characters in a string in upper case using the rules of the default locale. |
|
Returns all of the characters in a string in lower case using the rules of the default locale. |
|
Converts the initial letter of each word in a string to uppercase. |
|
|
Returns true, if a string matches the specified LIKE pattern. |
|
Returns true, if a string matches the specified SQL regex pattern. |
|
Returns the position of string in an other string starting at 1. |
|
Returns a string left-padded with the given pad string to a length of len characters. |
|
Returns a string right-padded with the given pad string to a length of len characters. |
|
Replaces a substring of string with a string starting at a position (starting at 1). |
|
Returns True if any (possibly empty) substring matches the regular expression, otherwise False. |
|
Returns a string with all substrings that match the regular expression consecutively being replaced. |
|
Returns a string extracted with a specified regular expression and a regex match group index. |
Returns the base string decoded with base64. |
|
Returns the base64-encoded result of the input string. |
|
Returns the numeric value of the first character of the input string. |
|
Returns the ASCII character result of the input integer. |
|
|
Decodes the first argument into a String using the provided character set. |
|
Encodes the string into a BINARY using the provided character set. |
|
Returns the leftmost integer characters from the input string. |
|
Returns the rightmost integer characters from the input string. |
Returns the position of the first occurrence in the input string. |
|
|
Returns the position of the first occurrence in the input string after position integer. |
|
Parse url and return various parameter of the URL. |
Returns a string that removes the left whitespaces from the given string. |
|
Returns a string that removes the right whitespaces from the given string. |
|
Returns a string that repeats the base string n times. |
|
|
Defines an aggregation to be used for a previously specified over window. |
Reverse each character in current string. |
|
|
Split target string with custom separator and pick the index-th(start with 0) result. |
|
Creates a map by parsing text. |
temporal functions#
Parses a date string in the form "yyyy-MM-dd" to a SQL Date. |
|
Parses a time string in the form "HH:mm:ss" to a SQL Time. |
|
Parses a timestamp string in the form "yyyy-MM-dd HH:mm:ss[.SSS]" to a SQL Timestamp. |
|
|
Extracts parts of a time point or time interval. |
|
If time_interval_unit is specified, it rounds down a time point to the given unit, e.g. |
|
If time_interval_unit is specified, it rounds up a time point to the given unit, e.g. |
advanced type helper functions#
|
Accesses the field of a Flink composite type (such as Tuple, POJO, etc.) by name or index and returns it's value. |
Converts a Flink composite type (such as Tuple, POJO, etc.) and all of its direct subtypes into a flat representation where every subtype is a separate field. |
|
|
Accesses the element of an array or map based on a key or an index (starting at 1). |
Returns the number of elements of an array or number of entries of a map. |
|
Returns the sole element of an array with a single element. |
|
|
Returns whether the given element exists in an array. |
time definition functions#
Declares a field as the rowtime attribute for indicating, accessing, and working in Flink's event time. |
|
Declares a field as the proctime attribute for indicating, accessing, and working in Flink's processing time. |
|
Creates an interval of the given number of years. |
|
Creates an interval of the given number of years. |
|
Creates an interval of the given number of quarters. |
|
Creates an interval of the given number of quarters. |
|
Creates an interval of the given number of months. |
|
Creates an interval of the given number of months. |
|
Creates an interval of the given number of weeks. |
|
Creates an interval of the given number of weeks. |
|
Creates an interval of the given number of days. |
|
Creates an interval of the given number of days. |
|
Creates an interval of the given number of hours. |
|
Creates an interval of the given number of hours. |
|
Creates an interval of the given number of minutes. |
|
Creates an interval of the given number of minutes. |
|
Creates an interval of the given number of seconds. |
|
Creates an interval of the given number of seconds. |
|
Creates an interval of the given number of millis. |
|
Creates an interval of the given number of millis. |
hash functions#
Returns the MD5 hash of the string argument; null if string is null. |
|
Returns the SHA-1 hash of the string argument; null if string is null. |
|
Returns the SHA-224 hash of the string argument; null if string is null. |
|
Returns the SHA-256 hash of the string argument; null if string is null. |
|
Returns the SHA-384 hash of the string argument; null if string is null. |
|
Returns the SHA-512 hash of the string argument; null if string is null. |
|
|
Returns the hash for the given string expression using the SHA-2 family of hash functions (SHA-224, SHA-256, SHA-384, or SHA-512). |
JSON functions#
|
Determine whether a given string is valid JSON. |
|
Determines whether a JSON string satisfies a given search criterion. |
|
Extracts a scalar from a JSON string. |
|
Extracts JSON values from a JSON string. |