array_get(array, index)
Miscellaneous functions
Documents additional functions and those contributed by other projects.
Returns the object value at a given array index.
array
is the object type, index
must be an integer, and the return type is an object.
1-based indexing is used. The actual array value should be a java.sql.Array or java array type. A null is returned if either argument is null, or if the index is out of bounds.
Returns the length for a given array.
array_length(array)
array
is the object type, and the return type is integer.
The actual array value should be a java.sql.Array or java array type. An exception is thrown if the array value is the wrong type.
Returns a universally unique identifier.
uuid()
The return type is string.
Generates a type 4 (pseudo randomly generated) UUID using a cryptographically strong random number generator. The format is XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX where each X is a hex digit.
Data Quality functions are contributed by the ODDQ Project.
The functions are prefixed with osdq.
, but can be called without the prefix.
Returns the randomized string. For example, jboss teiid
may randomize to jtids soibe
.
random(sourceValue)
The sourceValue
is the string to be randomized.
Returns digit characters of the string. For example, a1 b2 c3 d4
becomes 1234
.
digit(sourceValue)
The sourceValue
is the string from which you want to extract digit characters.
Returns the index of the first whitespace. For example, jboss teiid
will return 5
.
whitespaceIndex(sourceValue)
The sourceValue is the string from which you want to find the whitespace index.
Check whether a credit card number is valid. Returns true
if it matches credit card logic and checksum.
validCreditCard(cc)
cc
is the credit card number string to check.
Check whether a social security number (SSN) is valid. Returns true
if it matches SSN logic.
validSSN(ssn)
ssn
is the social security number string to check.
Check whether a phone number is valid.
Returns true
if the number matches phone logic.
Numbers must contain more than 8, but less than 12 characters, and cannot start with 000
.
validPhone(phone)
`phone
is the phone number string need to check.
Check whether an email address is valid.
Returns true
if valid.
validEmail(email)
email
is the email address string to check.
Returns the float distance between two strings based on the Cosine Similarity algorithm.
cosineDistance(a, b)
a
and b
are strings for which you want to calculate the distance.
Returns the float distance between two strings, based on the Jaccard similarity algorithm.
jaccardDistance(a, b)
The a
and b
are strings for which you want to calculate the distance.
Returns the float distance between two strings based on the Jaro-Winkler algorithm.
jaroWinklerDistance(a, b)
The a
and b
are strings for which you want to calculate the distance.
Returns the float distance between two strings based on the Levenshtein algorithm.
levenshteinDistance(a, b)
The a
and b
are strings for which you want to calculate the distance.
Returns the set of unique elements from the first set with cosine distance less than the specified value to every member of the second set.
intersectionFuzzy(a, b)
a
and b
are string arrays. c
is a float representing the distance, such that 0.0 or less will match any and > 1.0 will match exact.
Returns the set of unique elements from the first set with cosine distance less than the specified value to every member of the second set.
minusFuzzy(a, b, c)
a
and b
are string arrays. c
is a float representing the distance, such that 0.0 or less will match any and > 1.0 will match exact.
Returns the set of unique elements that contains members from the first set and members of the second set that have a cosine distance less than the specified value to every member of the first set.
unionFuzzy(a, b, c)
a
and b
are string arrays. c
is a float representing the distance, such that 0.0 or less will match any and > 1.0 will match exact.