4 Understanding Expression Builder Functions
Expression Builder is an editor that allows you to build expressions using various existing functions. The expressions help you in achieving the required results for your pipelines.
Topics:
What are Bessel Functions?
The mathematical cylinder functions for integers are known as Bessel functions.
Function Name | Description |
---|---|
|
Returns the modified Bessel function of order 0 of the double argument as a double |
|
Returns the exponentially scaled modified Bessel function of order 0 of the double argument as a double |
|
Returns the modified Bessel function of order 1 of the double argument as a double |
|
Returns the exponentially scaled modified Bessel function of order 1 of the double argument as a double |
|
Returns the Bessel function of the first kind of order n of the argument as a double |
|
Returns the modified Bessel function of the third kind of order n of the argument as a double |
|
Returns the exponentially scaled modified Bessel function of the third kind of order 0 of the double argument as a double |
|
Returns the exponentially scaled modified Bessel function of the third kind of order 1 of the double argument as a double |
|
Returns the Bessel function of the second kind of order n of the double argument as a double |
What are Conversion Functions?
The conversion functions help in converting values from one data type to other.
The following conversion functions are supported in this release:
Function Name | Description |
---|---|
|
Converts the given value to bigdecimal |
|
Converts the given value to logical |
|
Converts the given value to datetime |
|
Converts the given value to double |
|
Converts the given value to float |
|
Converts the given value to integer |
|
Converts the given value to long |
|
Converts the given value to string |
boolean(value1)
Converts the input argument value to logical. The input argument can be one of the following data type: big integer or integer. Returned value type will be Boolean.
Examples
Function | Result |
---|---|
|
TRUE |
|
FALSE |
|
TRUE |
|
TRUE |
|
TRUE |
double(value1)
Converts the input argument value to double. The input argument can be one of the following data types: integer, big integer, double, text or float. Returned value type will be double.
Examples
Function | Result |
---|---|
|
3.1405999660491943 |
|
1234.56005859375 |
float(value1)
Converts the input argument value to float. The input argument can be one of the following data types: integer, big integer, double, text or float. Returned value will be a single-precision floating-point number.
Examples
Function | Result |
---|---|
|
1.6789899 |
|
1.7967093 |
|
12.605081 |
What are Date Functions?
The following date functions are supported in this release:
Function Name | Description |
---|---|
|
Returns day of the date |
|
Returns event timestamp from stream |
|
Returns hour of the date |
|
Returns minute of the date |
|
Returns month of the date |
|
Returns nanosecond of the date |
|
Returns second of the date |
|
Returns the system’s timestamp on which the application is running |
|
Returns the provided timestamp in required time format |
|
Returns the current output time |
|
Returns year of the date |
Acceptable Formats for Timestamp Values
This sections lists the acceptable formats for timestamp values in Oracle Stream Analytics.
Format | Example Values |
---|---|
|
3/21/2018 11:14:23.1111 |
|
3/21/2018 11:14:23.111 |
|
3/21/2018 11:14:23.11 |
|
3/21/2018 11:14:23.1 |
|
3/21/2018 11:14:23 |
|
3/21/2018 11:14 |
|
3/21/2018 11 |
|
3/21/2018 |
|
11-21-2018 11:14:23.1111 |
|
11-21-2018 11:14:23.111 |
|
11-21-2018 11:14:23.11 |
|
11-21-2018 11:14:23.1 |
|
11-21-2018 11:14:23 |
|
11-21-2018 11:14 |
|
11-21-2018 11 |
|
11-21-2018 |
|
11-Jan-18 11.14.23.111111 AM |
|
11-Jan-18 11.14.23.1111 |
|
11-Jan-18 11.14.23.111 |
|
11-Jan-18 11.14.23.11 |
|
11-Jan-18 11.14.23.1 |
|
11-Jan-18 11.14.23 |
|
11-Jan-18 11.14 |
|
11-Jan-18 11 |
|
11-Jan-18 |
|
15/MAR/18 |
|
2018-03-5 15:16:0.756000 +5:30, 2018-03-5 15:16:0.756000 |
|
2018-03-5 15.16.0.756000 +5:30, 2018-03-5 15.16.0.756000 |
|
2018-03-5 15:16:0; 2018-03-5 15:16:0 +5:30 |
|
2018-03-5 15.16.0; 2018-03-5 15.16.0 +5:30 |
|
2018-03-5 15:16; 2018-03-5 15:16 +5:30 |
|
2018-03-5 15.16; 2018-03-5 15.16 +5:30 |
|
2018-03-5 15 |
|
2018-03-5 |
|
11:14:14 PST |
|
2018-03-04T12:08:56.235 |
|
2018-03-04T12:08:56.235-0700 |
|
2018-03-04T12:08:56.235 PDT |
|
2018-03-04T12:08:56 |
|
2018-03-04T12:08:56-0700 |
|
2018-03-04T12:08:56 PDT |
Day(date)
day(date)
function takes as an argument any one of the following data types: time interval or timestamp. The returned value represents the day of the week in the time represented by this date object. Returns a big integer indicating the day of the week represented by this date.
Examples
If Sunday=0, Monday=1 and so on, then:
Function | Result |
---|---|
|
3 |
|
4 |
hour(date)
hour(date)
function takes as an argument any one of the following data types: time interval or timestamp. The returned value represents the hour in the time represented by this date object. Returns a big integer indicating the hour of the time represented by this date.
Examples
Function | Result |
---|---|
|
09 |
|
12 |
minute(date)
minute(date)
function takes as an argument any one of the following data types: time interval or timestamp. The returned value represents the minutes in the time represented by this date object. Returns a big integer indicating the minutes of the time represented by this date.
Examples
Function | Result |
---|---|
|
15 |
|
45 |
month(date)
month(date)
function takes as an argument any one of the following data types: time interval or timestamp. The returned value represents the month of the year that contains or begins with the instant in time represented by this date object. Returns a big integer indicating the month of the year represented by this date.
Examples
Function | Result |
---|---|
|
12 |
|
9 |
second(date)
second(date)
function takes as an argument any one of the following data types: time interval or timestamp. The returned value represents the seconds of the instant in time represented by this date object. Returns a big integer indicating the seconds of the time represented by this date.
Example
Function | Result |
---|---|
|
22 |
|
35 |
Year(date)
year(date)
function takes as an argument any one of the following data types: time interval or time stamp. The returned value represents the year of the instant in time represented by this date object. Returns a big integer indicating the year represented by this date.
Examples
Function | Result |
---|---|
|
17 |
|
2015 |
What are Geometry Functions?
The Geometry functions allow you to convert the given values into a geometrical shape.
The following interval functions are supported in this release:
Function Name | Description |
---|---|
|
Returns a 2–dimensional point type geometry from the given latitude and longitude. The default SRID is 8307. The return value is of the datatype |
|
Returns distance between the first set of latitude, longitude and the second set of latitude, longitude values. The default SRID is 8307. The return value is of the datatype |
What are Interval Functions?
The Interval functions help you in calculating time interval from given values.
The following interval functions are supported in this release:
Function Name | Description |
---|---|
|
Converts the given value to an The return value is of the datatype |
|
Converts a string in format The return value is of the datatype |
What are Math Functions?
The math functions allow you to perform various mathematical operations and calculations ranging from simple to complex.
The following math functions are supported in this release:
Function Name | Description |
---|---|
|
Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard |
|
Returns the absolute value of a number |
|
Returns arc cosine of a value |
|
Returns arc sine of a value |
|
Returns arc tangent of a value |
|
Returns polar angle of a point ( |
|
Returns binomial coefficient of the base raised to the specified power |
|
BitMask with BitsSet (From, To) |
|
Returns cubic root of the specified value |
|
Rounds to ceiling |
|
Returns the first floating-point argument with the sign of the second floating-point argument |
|
Returns cosine of a value |
|
Returns cosine hyperbolic of a value |
|
Returns exponent of a value |
|
More precise equivalent of |
|
Returns factorial of a natural number |
|
Rounds to floor |
|
Returns the unbiased exponent used in the representation of a double |
|
Returns a deterministic seed as an integer from a (seemingly gigantic) matrix of predefined seeds |
|
Returns an integer hashcode for the specified double value |
|
Returns square root of sum of squares of the two arguments |
|
Returns the least significant 64 bits of this UUID's 128 bit value |
|
Calculates the log value of the given argument to the given base, where |
|
Returns the natural logarithm of a number |
|
Calculates the log value of the given argument to base 10 |
|
Calculates the log value of the given argument to base 2 |
|
Returns the natural logarithm (base e) of the factorial of its integer argument as a double |
|
Returns the factorial of its integer argument (in the range k >= 0 && k < 21) as a long |
|
Returns the maximum of 2 arguments |
|
Returns the minimum of 2 arguments |
|
Returns modulo of a number |
|
Returns the most significant 64 bits of this UUID's 128 bit value |
|
Returns the floating-point number adjacent to the first argument in the direction of the second argument |
|
Returns the floating-point value adjacent to the input argument in the direction of negative infinity |
|
Returns the floating-point value adjacent to the input argument in the direction of positive infinity |
|
Returns m raised to the nth power |
|
Returns the double value that is closest in value to the argument and is equal to a mathematical integer |
|
Rounds to the nearest integral value |
|
Returns d × 2scaleFactor rounded as if performed by a single correctly rounded floating-point multiply to a member of the double value set |
|
Returns signum of an argument as a double value |
|
Returns sine of a value |
|
Returns sine hyperbolic of a value |
|
Returns square root of a value |
|
Returns the correction term of the Stirling approximation of the natural logarithm (base e) of the factorial of the integer argument as a double |
|
Returns tangent of a value |
|
Returns tangent hyperbolic of a value |
|
Converts the argument value to degrees |
|
Returns the measurement of the angle in radians |
|
Returns the size of an ulp of the argument |
maximum(value1, value2)
Returns the maximum of two arguments. The first argument is a value to compare with the second argument’s value and can be any one of the following data type: big integer, double, interval, integer, float. The second argument is a value to compare with the first argument’s value and can be any one of the following data type: big integer, double, interval, integer, float.
Examples
Function | Result |
---|---|
|
1999220 |
|
135.50 |
Note:
If the user provides two different data types as input arguments, then Stream Analytics does implicit conversion to convert one of the argument to the other argument’s type.minimum(value1, value2)
Returns the minimum of two arguments. The first argument is a value to compare with the second argument’s value and can be any one of the following data type: big integer, double, interval, integer, float. The second argument is a value to compare with the first argument’s value and can be any one of the following data type: big integer, double, interval, integer, float.
Examples
Function | Result |
---|---|
|
16321 |
|
3.10 |
Note:
If the user provides two different data types as arguments, then Stream Analytics does implicit conversion to convert one argument to the other argument’s type.round(value1)
Rounds the argument value to the nearest integer value. The input argument can be of the following data types: big integer, double, integer, float.
Examples
Function | Result |
---|---|
|
7 |
|
39 |
|
4 |
What are Null-related Functions?
The following null-related functions are supported in this release:
Function Name | Description |
---|---|
|
Replaces null with a value of the same type |
nvl(value1, value2)
nvl
lets you replace null (returned as a blank) with a value of the same type as the first argument. For example, in a list of employees and commission, you can substitute Not Applicable if the employee receives no commission using the nvl(value1,value2)
function as nvl(Not Applicable,Commission)
.
Example
Function | Result |
---|---|
|
Not Applicable |
What are Statistical Functions?
Statistical functions help you in calculating the statistics of different values.
The following statistical functions are supported in this release:
Function Name | Description |
---|---|
|
Returns the area from zero to |
|
Returns the area under the right hand tail (from |
|
Returns the sum of the terms 0 through |
|
Returns the sum of the terms |
|
Returns the area under the left hand tail (from 0 to |
|
Returns the area under the right hand tail (from |
|
Returns the error function of the normal distribution |
|
Returns the complementary error function of the normal distribution |
|
Returns the gamma function of the arguments |
|
Returns the integral from |
|
Returns the incomplete beta function evaluated from zero to |
|
Returns the incomplete gamma function |
|
Returns the complemented incomplete gamma function |
|
Returns the natural logarithm of the gamma function |
|
Returns the sum of the terms 0 through |
|
Returns the sum of the terms |
|
Returns the area under the normal (Gaussian) probability density function, integrated from minus infinity to |
|
Returns the value for which the area under the normal (Gaussian) probability density function is equal to the argument |
|
Returns the sum of the first |
|
Returns the sum of the terms |
|
Returns the integral from minus infinity to |
|
Returns the value, for which the area under the Student-t probability density function is equal to |
What are String Functions?
The following String functions are supported in this release:
Function Name | Description |
---|---|
|
Returns the first non-null expression in the list. If all expressions evaluate to null, then the COALESCE function will return null |
|
Returns concatenation of values converted to strings |
|
Returns first index of |
|
Returns a specified text expression, with the first letter of each word in uppercase and all other letters in lowercase |
|
Returns the length of the specified string |
|
Returns a matching pattern |
|
Converts the given string to lower case |
|
Pads the left side of a string with a specific set of characters (when |
|
Removes all specified characters from the left hand side of a string |
|
Replaces all |
|
Pads the right side of a string with a specific set of characters (when |
|
Removes all specified characters from the right hand side of a string |
|
Returns substring of a 'string' when indices are between 'from' (inclusive) and up to the end of the string |
|
Returns substring of a \'string\' when indices are between \'from\' (inclusive) and \'to\' (exclusive) |
|
Replaces a sequence of characters in a string with another set of characters. However, it replaces a single character at a time. |
|
Converts given string to uppercase |
coalesce(value1,... )
coalesce
returns the first non-null expression in the list of expressions. You must specify at least two expressions. If all expressions evaluate to null then the coalesce
function will return null.
For example:
In coalesce(expr1,expr2)
:
-
If
expr1
is not null then the function returnsexpr1
. -
If
expr1
is null then the function returnsexpr2
. -
If
expr1
andexpr2
are null then the function returns null.
In coalesce(expr1,expr2,......,exprn)
-
If
expr1
is not null then the function returnsexpr1
. -
If
expr1
is null then the function returnsexpr2
. -
If
expr1
andexpr2
are null then the function returns the next non-null expression.
length(value1)
Returns the length in characters of the string passed as an input argument. The input argument is of the data type text. The returned value is an integer representing the total length of the string.
If value1 is null, then length(value1)
returns null.
If value1 is an empty string, then length(value1)
returns null.
Examples
Function | Result |
---|---|
|
3 |
|
ERROR: Function has invalid parameters. |
|
4 |
|
NULL |
|
NULL |
|
30 |
lower(value1)
Converts a string to all lower-case characters. The input argument is of the data type text. The returned value is the lowercase of the specified string.
Examples
Function | Result |
---|---|
|
product |
|
abcdef |
|
abc |
replace(string, match, replacement)
Replaces all match
characters in a string with replacement
characters. The first input argument is the string
and is of the data type text. The second argument is the match
and is of the data type text. The third argument is replacement
and is of data type text. The returned value is a text in which the third string argument (replacement
) replaces the second string argument (match
).
If match
is not found in the string, then the original string will be returned.
Examples
Function | Result |
---|---|
|
aabbffdd |
|
aabbffcdd |
|
aabbddee |
substring(string, from, to)
Returns a substring of a string when indices are between from
(inclusive) and to
(exclusive). The first input argument is the string
and is of the data type text. The second argument is the start index and is an integer. The third argument is the finish index and is an integer. The returned value is a substring and is of type text.
Examples
Function | Result |
---|---|
|
cdef |
|
abcde |