Miscellaneous Functions

Array functions

array_get

Returns the object value at a given array index.

array_get(array, index)

array is the object type, index must be an integer, and the return type is object.

1-based indexing is used. The actual array value should be a java.sql.Array or java array type. A null will be returned if either argument is null or if the index is out of bounds.

array_length

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 will be thrown if the array value is the wrong type.

Other Functions

uuid

Retuns 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

Data Quality functions are contributed by the ODDQ Project. The functions are prefixed with 'osdq.', but may be called without the prefix.

osdq.random

Returns the randomized string. For example, jboss teiid may randomize to jtids soibe.

random(sourceValue)

The sourceValue is the string that need to randomize.

osdq.digit

Returns digit characters of the string. For example, a1 b2 c3 d4 will become 1234

digit(sourceValue)

The sourceValue is the string that need to digit.

osdq.whitespaceIndex

Returns the index of the first whitespace, For example, jboss teiid will return 5.

whitespaceIndex(sourceValue)

The sourceValue is the string that need to find whitespace index.

osdq.validCreditCard

Check whether a Credit Card number is a valid Credit Card number, return true if matches credit card logic and checksum.

validCreditCard(cc)

The cc is the Credit Card number string that need to check.

osdq.validSSN

Check whether a SSN number is a valid SSN number, return true if matches ssn logic.

validSSN(ssn)

The ssn is the SSN number string that need to check.

osdq.validPhone

Check whether a phone number is a valid phone number, return true if matches phone logic that more than 8 character less than 12 character, can’t start with 000.

validPhone(phone)

The phone is the phone number string need to check.

osdq.validEmail

Check whether a email address is a valid email address, return true if valid.

validEmail(email)

The email is the email adress string that need to check.

osdq.cosineDistance

Returns the float distance between two string which base on Cosine Similarity algorithm.

cosineDistance(a, b)

The a and b are strings that need to calculate the distance.

osdq.jaccardDistance

Returns the float distance between two string which base on Jaccard similarity algorithm.

jaccardDistance(a, b)

The a and b are strings that need to calculate the distance.

osdq.jaroWinklerDistance

Returns the float distance between two string which base on Jaro-Winkler algorithm.

jaroWinklerDistance(a, b)

The a and b are strings that need to calculate the distance.

osdq.levenshteinDistance

Returns the float distance between two string which base on Levenshtein algorithm.

levenshteinDistance(a, b)

The a and b are strings that need to calculate the distance.

osdq.intersectionFuzzy

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)

The 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.

osdq.minusFuzzy

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)

The 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.

osdq.unionFuzzy

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)

The 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.

results matching ""

    No results matching ""