Package dev.frostlake.functions.scalar.semistructured
package dev.frostlake.functions.scalar.semistructured
-
ClassesClassDescriptionARRAY_APPEND(array, value) — appends value to array and returns the new array.ARRAY_CAT(array1, array2) — concatenates two arrays.ARRAY_COMPACT(array) — returns the array with all null elements removed.ARRAY_CONSTRUCT(val1, val2, ...) — builds a JSON array from the given values.ARRAY_CONSTRUCT_COMPACT(val1, val2, …) — builds a JSON array from the given values, OMITTING every SQL NULL (so the result can be shorter than the argument list).ARRAY_CONTAINS(value, array) — returns TRUE if the array contains the value.ARRAY_DISTINCT(array) — removes duplicate elements.ARRAY_EXCEPT(array1, array2) — the MULTISET difference: max(0, N-M) copies of each element.ARRAY_FLATTEN(array) — flattens one level of nested arrays.ARRAY_GENERATE_RANGE(start, stop [, step]) — an array of integers from start (inclusive) to stop (EXCLUSIVE). step defaults to 1 and may be negative.ARRAY_INSERT(array, pos, element) — inserts element at 0-based index pos, shifting later elements right.ARRAY_INTERSECTION(array1, array2) — the MULTISET intersection: min(N, M) copies of each element.ARRAY_MAX(array) — the largest non-null element as a VARIANT (live-verified: ARRAY_MAX(['a','c','b']) displays as
"c"with JSON quotes and SYSTEM$TYPEOF is VARIANT), or SQL NULL if the array is empty, all-null, or NULL.ARRAY_MIN(array) — the smallest non-null element as a VARIANT (live-verified: a text element keeps its JSON-quoted form and SYSTEM$TYPEOF is VARIANT, mirroring ARRAY_MAX), or SQL NULL if the array is empty, all-null, or NULL.ARRAY_POSITION(value, array) — 0-based index of the first element equal to value, or NULL.ARRAY_PREPEND(array, value) — prepends value to the front of the array.ARRAY_REMOVE(array, value) — removes all occurrences of value from array.ARRAY_REMOVE_AT(array, index) — removes element at given index (0-based).ARRAY_REPEAT(value, n) — an array of n copies of the value.ARRAY_REVERSE(array) — returns the array with its elements in reverse order.ARRAY_SIZE(array) — returns the number of elements.ARRAY_SLICE(array, from, to) — returns a sub-array from index `from` (inclusive) to `to` (exclusive).ARRAY_SORT(array [, sort_ascending [, nulls_first]]) — sorts elements. sort_ascending defaults to TRUE.ARRAYS_OVERLAP(array1, array2) — returns TRUE if the arrays share at least one element.ARRAYS_TO_OBJECT(keys, values) — an object pairing the key array with the value array by index.ARRAYS_ZIP(a1, a2, …) — an array of objects pairing same-index elements under keys $1, $2, ….ARRAY_TO_STRING(array, delimiter) — joins array elements with a delimiter.AS_BINARY(v) — the value when it is BINARY, else NULL (the engine's variant model carries no binary members).AS_DATE(v) — the value when it is a DATE, else NULL (variant members carry dates as text).AS_DECIMAL(v [, precision [, scale]]) — the variant's numeric value as a fixed-point number rounded (HALF_UP) to the given scale, else NULL.AS_TIME(v) — the value when it is a TIME, else NULL.AS_TIMESTAMP_NTZ(v) — the value when it is a TIMESTAMP, else NULL (LTZ/TZ alias here too).CHECK_JSON(str) — returns NULL if valid JSON, otherwise an error description string.CHECK_XML(text [, disable_auto_convert]) — NULL when the input is NULL, empty, or a valid XML document; otherwise the parse-error message (without theError parsing XML:prefix PARSE_XML uses).GET_IGNORE_CASE(obj, key) — like GET but matches object keys case-insensitively.GET(object_or_array, field_or_index) — extracts a value by key (object) or index (array).IS_BINARY(v) — TRUE when the value is BINARY (never true for variant members in this engine's model).IS_DATE(v) — TRUE when the value is a DATE (variant members carry dates as text, so those are FALSE).IS_DECIMAL(v) — TRUE when the variant holds a fixed-point number (integral or decimal node).IS_DOUBLE(v) — TRUE when the variant holds any number (Snowflake: DOUBLE, INTEGER or DECIMAL).IS_TIME(v) — TRUE when the value is a TIME.IS_TIMESTAMP_NTZ(v) — TRUE when the value is a TIMESTAMP (LTZ/TZ alias here; the engine models all as NTZ).JSON_EXTRACT_PATH_TEXT(json, path) — parses the JSON text and returns the path's value as unquoted text.MAP_CAT(map1, map2) — the concatenation (merge) of two MAPs.MAP_CONSTRUCT(key, value [, key, value …]) — a MAP built from alternating key/value arguments.MAP_CONTAINS_KEY(key, map) — whether the map holds the key.MAP_DELETE(map, key [, key …]) — the map without the named keys.MAP_ENTRIES(map) — the map's entries as an array of{"key": …, "value": …}objects, in key order.Types and shared reads for the MAP built-in family (MAP_KEYS, MAP_SIZE, MAP_CAT and the rest).MAP_INSERT(map, key, value [, updateFlag]) — the map with one entry added or replaced.MAP_KEYS(map) — the map's keys as an array, in key order.MAP_PICK(map, key [, key …]) and MAP_PICK(map, keyArray) — the map narrowed to the named keys.MAP_SIZE(map) — the number of entries.OBJECT_CONSTRUCT(k1, v1, k2, v2, ...) — builds an object from key-value pairs.OBJECT_DELETE(object, key1 [, key2, ...]) — removes one or more keys from an object.OBJECT_INSERT(object, key, value [, update_flag]) — inserts/updates a key in an object.OBJECT_KEYS(object) — returns an array of the object's keys.OBJECT_PICK(object, key1 [, key2, ...]) — returns an object with only the specified keys.PARSE_XML(text [, disable_auto_convert]) — parses an XML document into Snowflake's XML-in-VARIANT model (seeXmlVariants):{"$": content, "@": tag, "@attr": value, "childname": firstContentIndex}with object keys sorted.TO_ARRAY(expr) — NULL (or JSON null) returns NULL; an existing array is returned unchanged; any other scalar value is wrapped in a single-element array.TO_OBJECT(expr) — NULL (or JSON null) returns NULL; an OBJECT (or a VARIANT containing an OBJECT) is returned as an object.TO_VARIANT(expr) — wraps a value as a typed VARIANT.TO_XML(variant) — the XML text of a semi-structured value.XMLGET(xml, tag_name [, instance]) — theinstance-th (0-based, default 0) direct child element with the given tag name, taken from the XML element's"$"content; SQL NULL when the value is not an XML element, the tag does not occur (matching is case-sensitive), or the instance is out of range (a negative instance is NULL too, live-verified).