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 | 
|---|---|
| Returns an array containing all elements from the source array as well as the new element. | |
| 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. | |
| Tests if an array contains a value. | |
| Returns a new array that contains only the distinct elements from the input array after removing duplicate elements. | |
| returns the number of elements in an array, or null if input is not an array | |
| Return the maximum value in an array. | |
| Return the minimum value in an array. | |
| Returns a null value of type array. | |
| Cast all values in an array to  | |
| Returns an array containing the multiset union of input arrays. | |
| Compares whether two arrays have at least one element in common. | |
| Returns a concatenation of N arrays  | |
| 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 key (which can be a column value or some string concatenation, for example), look | |
| 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 | |
| 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 | |
| Returns an array containing all elements from the source array as well as the new element. | |
| Returns an array containing the matching elements inside the two input arrays. | |
| Returns an array constructed from zero, one or more input arguments. | |
| Returns an array that contains a list of consecutive integers ranging from  | |
| Extend an existing object with new fields. | |
| Turn a sequence of name:value elements into an object. | |
| Merge one or more objects into a single object. | |
| Convert a datum into an object or NULL if conversion is impossible | |
| Extract aggregated fields and values from a group of rows into a new JSON object. | |
| Get an array of top-level keys from an object type field (field names from JSON objects). | |
| 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. | |
| Parse an IPv4 or IPv6 network address into relevant attributes. | |
| 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. | |
| Returns an array containing all elements from the source array as well as the new element. | |
| Given an array, returns a possibly smaller array, starting at the given  | |
| Return an array with the elements of the input array in sorted order. | |
| Splits the string into an array, based on the separator. | |
| Splits the string into an array based on separator, which is treated as a set of characters. | |
| Returns an approximation of the top K most frequent values in the input, along with their approximate frequencies. | |
| Convert an object into an array of “key”-“value” pairs. |