OPAL Semistructured Functions¶
Semistructured functions act upon or produce, arrays or objects that are treated as scalars. E.g., a single column may contain multiple values in an array, or multiple key/value tuples in an object.
The values inside semi-structured containers are stored as variants, and must be cast to the type you expect them to have. If the array or object contains a value of an unexpected type, the cast returns null.
Function |
Description |
---|---|
Convert a datum into an array or NULL if conversion is impossible. |
|
Returns an array of concatenated input values. |
|
Returns an array of distinct input values. |
|
Returns a null value of type array. |
|
Cast all values in an array to |
|
Identify the browser used for a web request from its |
|
Drop one or more fields from an object. |
|
Embed parameters into the given prepared SQL statement by replacing occurrences of the placeholder character ‘?. |
|
Given an object, and a computed string value as a key, which can be a column value or some string concatenation, for example, look up whether that key exists in that object. |
|
Given an array and a computed index, return the item at that index in the array. |
|
Process an object or array expression using a query written in the JMESPath query language. |
|
Returns an array containing all parts of the argument string that match the given regular expression, which may be empty if nothing matches. |
|
Given an array and a value, return the index of the first occurrence of that value within that array, or NULL if the value isn’t found in the array. The index of the first element in an array is 0. |
|
Returns an array constructed from zero, one or more input arguments. |
|
Extend an existing object with new fields. |
|
Return true if the argument input string or object (converted to a string) matches the argument regular expression. |
|
Convert a datum into an object or NULL if conversion is impossible. |
|
Returns one OBJECT per group. |
|
Get array of object keys (field names from object). |
|
Returns a null value of type object. |
|
Parses an input string as character-separated values, where the default separator is a comma (comma-separated values). |
|
When the input is an IPv(4/6) address, returns a JSON object containing the following attributes - family (either “4” or “6”) |
|
Parse the argument value as a JSON string. |
|
Returns an object of key=value pairs extracted from an input string. |
|
Returns a JSON object consisting of all the components (fragment, host, path, port, query, scheme). |
|
Given a column and path, return whether the JSON path exists in that column. |
|
Pick one or more fields from an object. |
|
Converts an array of “key”-“value” pairs into an object with key-value attributes. |
|
Given an array, returns a possibly smaller array, starting at the given |
|
Splits the string into an array, based on the separator. |
|
Splits the string into an array based on a separator, which is treated as a set of characters. |
|
Convert an object into an array of “key”-“value” pairs. |