Package dev.frostlake.functions.scalar.string


package dev.frostlake.functions.scalar.string
  • Classes
    Class
    Description
     
     
     
    CHARINDEX(needle, haystack [, start]) — POSITION's argument order; BINARY pairs search by BYTE.
     
    COLLATE(expr, 'spec'), also written expr COLLATE 'spec': the string itself, carrying the named collation into whatever compares it.
    COLLATION(expr): the collation specification expr carries, lower-cased, or NULL when it carries none.
     
     
     
     
     
    ILIKE(subject, pattern) — the function-call form of the subject ILIKE pattern operator (case-INsensitive SQL wildcard match).
     
    INSERT(base, position, length, insertion).
    JAROWINKLER_SIMILARITY(string1, string2) — the Jaro-Winkler similarity of the two strings scaled to an integer 0–100 (0 = no similarity, 100 = exact match), matching Snowflake.
    LEFT(expr, n) — the leading n characters of a VARCHAR, or the leading n BYTES of a BINARY.
     
     
    LIKE(subject, pattern) — the function-call form of the subject LIKE pattern operator (case-sensitive SQL wildcard match, % = any run, _ = one char).
     
    LPAD(expr, len [, pad]) — a VARCHAR padded to len characters, or a BINARY padded to len BYTES.
     
    NORMALIZE(x, lo, hi) — Snowflake's min-max normalization (x - lo) / (hi - lo), NOT Unicode normalization (live-verified: NORMALIZE(5, 0, 10) is 0.5).
     
    PARSE_IP(ip_address, type [, permissive]) — parses an IPv4/IPv6 address (optionally in CIDR addr/prefix form) into a VARIANT OBJECT, matching Snowflake.
    PARSE_URL(url [, permissive]) — parses a URL into a VARIANT OBJECT with Snowflake's keys, in ALPHABETICAL order (live-verified): fragment, host, parameters, path, port, query, scheme.
    POSITION(needle, haystack [, start]) — the 1-based position of needle, or 0 when absent.
    RANDSTR(length, generator) — a deterministic random alphanumeric string seeded by the generator.
    REGEXP_COUNT(subject, pattern [, position [, parameters]]) — the number of matches of pattern at or after position (1-based, default 1).
    Shared helpers for the REGEXP_* functions: translating Snowflake's regex_parameters flag string to Pattern flags, detecting the e (extract) flag, and converting a Snowflake replacement string (backreferences \0–\9) to Java's replacement syntax.
    REGEXP_INSTR(subject, pattern [, position [, occurrence [, option [, parameters [, group_num]]]]]) — the 1-based position of the occurrence-th match (default 1) at or after position (default 1), or 0 when there is none.
    REGEXP_LIKE(subject, pattern [, parameters]) — TRUE when pattern matches the ENTIRE subject (implicitly anchored, as in Snowflake).
    REGEXP_REPLACE(subject, pattern [, replacement [, position [, occurrence [, parameters]]]]) — replace matches of pattern with replacement.
    REGEXP_SUBSTR(subject, pattern [, position [, occurrence [, parameters [, group_num]]]]) — the occurrence-th match (default 1) at or after position (1-based, default 1).
    REGEXP_SUBSTR_ALL(subject, pattern [, position [, occurrence [, parameters [, group_num]]]]) — returns a VARIANT ARRAY with an element for every match at or after position (1-based, default 1), starting from the occurrence-th match (default 1).
    REPEAT(s, n): the string n times over, NULL when either argument is NULL.
     
    REVERSE(expr) — a VARCHAR reversed by characters, or a BINARY reversed by BYTES.
    RIGHT(expr, n) — the trailing n characters of a VARCHAR, or the trailing n BYTES of a BINARY.
    RPAD(expr, len [, pad]) — a VARCHAR padded to len characters, or a BINARY padded to len BYTES.
     
    RTRIMMED_LENGTH(s) — the length of the string without trailing blanks.
    SEARCH(data, query [, ANALYZER => '…'] [, SEARCH_MODE => 'OR'|'AND']) — full-text token search, matching Snowflake's semantics with the default analyzer: both sides tokenize on non-alphanumeric boundaries, case-insensitively; OR mode (the default) is TRUE when ANY query token occurs among the data tokens, AND mode when ALL of them do.
     
    SPACE(n): n blanks.
    SPLIT(string, delimiter) — splits string on the literal delimiter into an ARRAY of substrings (rendered as a JSON array, the engine's VARIANT representation).
     
     
     
    STRTOK_TO_ARRAY(string [, delimiters]) — tokenizes string on any character in delimiters (each character is its own delimiter; the default is a single space) and returns a VARIANT ARRAY of the non-empty tokens.
    SUBSTRING(expr, start [, length]) — a slice of a VARCHAR by characters or of a BINARY by BYTES.
     
     
    TRY_PARSE_IP — PARSE_IP that returns NULL instead of erroring on invalid input.
    TRY_VALIDATE_UTF8(x) — the input as a string when its bytes are valid UTF-8, else NULL.
     
     
    VALIDATE_UTF8(x) — the input as a string when its bytes are valid UTF-8.