Uses of Class
dev.frostlake.functions.BuiltInFunction

Packages that use BuiltInFunction
  • Uses of BuiltInFunction in dev.frostlake.functions

    Modifier and Type
    Class
    Description
    class 
    Base class for aggregate functions (SUM, COUNT, LISTAGG, …).
    class 
    A built-in that reads its arguments as NUMBERS, and therefore refuses a statically OBJECT- or ARRAY-typed value in EVERY argument position — the numeric twin of TextArgumentFunction, and the same live message shape ("Invalid argument types for function 'ABS': (OBJECT)", SQLSTATE 42P13).
    class 
    A built-in that reads its argument as a VARIANT and therefore refuses a STRUCTURED one — an OBJECT(x VARCHAR), an ARRAY(INT) or a MAP(VARCHAR, INT) — in EVERY argument position, while taking the plain semi-structured OBJECT and ARRAY happily.
    class 
    A built-in that reads its arguments as text, and therefore refuses a statically OBJECT- or ARRAY-typed value in EVERY argument position.
    class 
    A built-in that NAVIGATES a semi-structured value — reads a key, an index, a size, or splices a new element in — and therefore refuses a GEOSPATIAL one in EVERY argument position, while taking a plain OBJECT or ARRAY and a STRUCTURED one alike.
    Modifier and Type
    Method
    Description
    FunctionRegistry.getFunction(String name)
     
    Methods in dev.frostlake.functions that return types with arguments of type BuiltInFunction
    Modifier and Type
    Method
    Description
    FunctionRegistry.getAllFunctions()
     
    Methods in dev.frostlake.functions with parameters of type BuiltInFunction
    Modifier and Type
    Method
    Description
    void
    FunctionRegistry.register(BuiltInFunction function)
     
    void
    FunctionRegistry.registerAlias(String name, BuiltInFunction function)
    Registers an alias name for an already-constructed function (used by FunctionProviders).
  • Uses of BuiltInFunction in dev.frostlake.functions.aggregate

    Modifier and Type
    Class
    Description
    class 
    ANY_VALUE(expr) — an arbitrary non-NULL value from the group (this implementation keeps the first one it sees), or NULL when the group holds none.
    class 
    APPROX_COUNT_DISTINCT(expr) — an approximate count of the distinct non-NULL values in the group, estimated with the HllAccumulator HyperLogLog sketch (~0.8% standard error, near-exact at low cardinality).
    class 
    APPROX_PERCENTILE(expr, percentile) — the approximate value at the given percentile (a constant in [0, 1]) of expr.
    class 
    APPROX_PERCENTILE_ACCUMULATE(expr): the PercentileDigest of a numeric input as an OBJECT state, for APPROX_PERCENTILE_COMBINE to merge and APPROX_PERCENTILE_ESTIMATE to read.
    class 
    APPROX_PERCENTILE_COMBINE(state): the APPROX_PERCENTILE_ACCUMULATE states of its input merged into one digest — every centroid kept with its weight, sorted by mean.
    class 
    APPROX_PERCENTILE_ESTIMATE(state, percentile): the value at a fraction of an APPROX_PERCENTILE_ACCUMULATE or APPROX_PERCENTILE_COMBINE state, as a FLOAT — the same number APPROX_PERCENTILE gives over the values the state was built from (see PercentileDigest for the weighted reading of a hand-written state).
    class 
    APPROX_TOP_K(expr [, k [, counters]]): the k most frequent values of the input as an ARRAY of [value, count] pairs, count descending, computed by the Space-Saving summary in TopKSummary over counters counters (default 100000; k defaults to 1).
    class 
    APPROX_TOP_K_ACCUMULATE(expr, counters): the whole TopKSummary of the input as an OBJECT state — {"counters":C,"datatype":T,"precision":P,"scale":S,"state":[[value, count], …], "type":"approx_top_k"} — for APPROX_TOP_K_COMBINE to merge and APPROX_TOP_K_ESTIMATE to rank.
    class 
    APPROX_TOP_K_COMBINE(state [, counters]): the APPROX_TOP_K_ACCUMULATE states of its input merged into one — equal values add their counts, nothing is inherited — and trimmed to counters (a constant between 1 and 100000; by default the inputs' own limit, which every input must share: differing limits refuse with Invalid parameter value: ApproxTopK state. Reason: combining states with different numbers of counters).
    class 
    APPROX_TOP_K_ESTIMATE(state [, k]): the k most frequent [value, count] pairs of an APPROX_TOP_K_ACCUMULATE or APPROX_TOP_K_COMBINE state, as APPROX_TOP_K would list them (k defaults to 1 and is a constant between 1 and 100000, judged at compile time).
    class 
     
    class 
    ARRAY_UNION_AGG(array) — an aggregate whose every input row is itself an ARRAY.
    class 
    ARRAY_UNIQUE_AGG(expr) — an aggregate that collects the DISTINCT non-NULL scalar input values (each input row contributes a single element, not an array) into a VARIANT ARRAY.
    class 
    AVG(expr) — see AvgAccumulator / AggregateNumerics.avg(Iterable) for the live-verified Snowflake result typing (fixed-point inputs → BigDecimal scale = max input scale + 6, HALF_UP; any double/VARIANT input → double; empty → NULL).
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    The three boolean aggregates' shared argument rule.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    HASH_AGG(expr) — a single, order-INDEPENDENT signed 64-bit hash over the whole (multi)set of input rows.
    class 
     
    class 
    LISTAGG(<expr> [, <delimiter>]) — concatenate values into a single string.
    class 
     
    class 
    MAX_BY(value, sort_key) — a two-argument aggregate returning the value from the row whose sort_key is the maximum.
    class 
     
    class 
     
    class 
    MIN_BY(value, sort_key) — a two-argument aggregate returning the value from the row whose sort_key is the minimum.
    class 
     
    class 
    OBJECT_AGG(key, value) — aggregates key/value pairs into a single OBJECT.
    class 
     
    class 
     
    class 
    REGR_AVGX(y, x) — average of the independent variable x over non-null (y, x) pairs (y dependent, x independent).
    class 
    REGR_AVGY(y, x) — average of the dependent variable y over non-null (y, x) pairs (y dependent, x independent).
    class 
    REGR_COUNT(y, x) — count over non-null (y, x) pairs (y dependent, x independent).
    class 
    REGR_INTERCEPT(y, x) — y-intercept of the least-squares regression line over non-null (y, x) pairs (y dependent, x independent).
    class 
    REGR_R2(y, x) — coefficient of determination (R squared) over non-null (y, x) pairs (y dependent, x independent).
    class 
    REGR_SLOPE(y, x) — slope of the least-squares regression line over non-null (y, x) pairs (y dependent, x independent).
    class 
    REGR_SXX(y, x) — sum of squares of x deviations over non-null (y, x) pairs (y dependent, x independent).
    class 
    REGR_SXY(y, x) — sum of products of x and y deviations over non-null (y, x) pairs (y dependent, x independent).
    class 
    REGR_SYY(y, x) — sum of squares of y deviations over non-null (y, x) pairs (y dependent, x independent).
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    VECTOR_AVG(v) — the element-wise MEAN of a group's vectors, always a VECTOR(FLOAT, n): over the rows [1,2,3] and [4,5,6] it is [2.5,3.5,4.5] (live-verified).
    class 
    VECTOR_MAX(v) — the element-wise MAXIMUM of a group's vectors, keeping the element type: over the rows [1,9,3], [4,5,-6] and [7,2,0] it is [7.0,9.0,3.0] (live-verified), i.e. each dimension is maximised on its own.
    class 
    VECTOR_MIN(v) — the element-wise MINIMUM of a group's vectors, keeping the element type: over the rows [1,9,3], [4,5,-6] and [7,2,0] it is [1.0,2.0,-6.0] (live-verified), i.e. each dimension is minimised on its own.
    class 
    VECTOR_SUM(v) — the element-wise SUM of a group's vectors, keeping the element type: over the rows [1,2,3] and [4,5,6] it is [5.0,7.0,9.0] (live-verified).
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar

    Modifier and Type
    Class
    Description
    class 
    GROUPING(col) — returns 1 if the column is aggregated (NULL due to ROLLUP/CUBE), 0 if the column participates in grouping for this row.
    class 
    GROUPING_ID(e1, …, en) — returns the integer bit-vector describing which of the grouping expressions are aggregated over in the current row: each ei contributes one bit (1 when it is rolled up / not in this grouping set, 0 when it is grouped by), with e1 as the most significant bit.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.conditional

    Modifier and Type
    Class
    Description
    class 
    BOOLAND(expr1, expr2) — three-valued logical AND over numeric/boolean inputs (non-zero is TRUE, zero is FALSE).
    class 
    BOOLNOT(expr1) — three-valued logical NOT over a numeric/boolean input (non-zero is TRUE, zero is FALSE).
    class 
    BOOLOR(expr1, expr2) — three-valued logical OR over numeric/boolean inputs (non-zero is TRUE, zero is FALSE).
    class 
    BOOLXOR(expr1, expr2) — three-valued logical exclusive-OR over numeric/boolean inputs (non-zero is TRUE, zero is FALSE).
    class 
     
    class 
    DECODE(expr, search1, result1 [, search2, result2 ...] [, default]) Like a searched CASE: compares expr to each search value and returns the matching result.
    class 
    EQUAL_NULL(a, b) — NULL-safe equality: returns TRUE if both NULL, TRUE if equal, FALSE otherwise.
    class 
     
    class 
    GREATEST_IGNORE_NULLS — the largest non-NULL argument, IGNORING NULLs (Snowflake's explicit skipping variant; plain LEAST/GREATEST return NULL when any argument is NULL).
    class 
     
    class 
     
    class 
     
    class 
    LEAST_IGNORE_NULLS — the smallest non-NULL argument, IGNORING NULLs (Snowflake's explicit skipping variant; plain LEAST/GREATEST return NULL when any argument is NULL).
    class 
     
    class 
     
    class 
     
    class 
    NVL2(expr1, expr2, expr3) — returns expr2 when expr1 is NOT NULL, otherwise expr3.
    class 
    REGR_VALX(y, x) — x when BOTH arguments are non-NULL, else NULL.
    class 
    REGR_VALY(y, x) — y when BOTH arguments are non-NULL, else NULL.
    class 
    ZEROIFNULL refuses more DECLARED families than its numeric-argument neighbours: a SQL BOOLEAN, every temporal flavour and a BINARY are each a compile-time argument-type error — positioned at the call, the family named with its parameters ((BOOLEAN), (DATE), (TIME(9)), (TIMESTAMP_NTZ(9)), (BINARY(67108864))) — while NUMBER, FLOAT, VARCHAR and VARIANT convert, a VARIANT even when it holds the same boolean that is refused declared (all live-verified).
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.context

    Modifier and Type
    Class
    Description
    class 
    AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE => n) — the minimum group size an AGGREGATION POLICY imposes.
    class 
    CURRENT_ACCOUNT() function - returns the account identifier The account ID can be configured in the frostlake.properties file with the key 'account.id'
    class 
    CURRENT_ACCOUNT_NAME() — the account's NAME, configured through account.name.
    class 
    CURRENT_AVAILABLE_ROLES() — a JSON array (as text) of every role the session can use: the active roles, the roles granted to the current user, and the closure of roles granted to those roles.
    class 
    CURRENT_CLIENT() — the identifier of the client library the session is connecting through.
    class 
     
    class 
     
    class 
    CURRENT_IP_ADDRESS() — the client IP address (loopback for the embedded engine).
    class 
    CURRENT_ORGANIZATION_NAME() — the organization the account belongs to, configured through organization.name.
    class 
     
    class 
     
    class 
    CURRENT_ROLE_TYPE() — the current role type (always an account-level ROLE here).
    class 
     
    class 
    CURRENT_SCHEMAS() — the active search path as a JSON array of the current schema.
    class 
    CURRENT_SECONDARY_ROLES() — the active secondary roles (none in the embedded engine).
    class 
     
    class 
    CURRENT_STATEMENT() — the text of the statement being executed, from the session.
    class 
     
    class 
     
    class 
    CURRENT_TRANSACTION() — the open transaction id (ids are not exposed; NULL, as Snowflake returns outside a transaction).
    class 
     
    class 
    CURRENT_VERSION() — the version of the running engine, taken from BuildInfo.version() so it tracks the built artifact.
    class 
     
    class 
    GET_DDL('<object_type>', '<object_name>' [, <use_fully_qualified_names>]) — reconstructs a CREATE OR REPLACE statement for an object from the catalog.
    class 
    INVOKER_ROLE() — the invoking role (the current role in the embedded engine).
    class 
    IS_ROLE_IN_SESSION(name) — TRUE when the named role is the session's current role.
    class 
    JOIN_CONSTRAINT(JOIN_REQUIRED => <boolean>) — what a JOIN POLICY's body returns.
    class 
    LAST_QUERY_ID() function - returns the query ID of the last executed query
    class 
    LAST_TRANSACTION() — the last transaction id (ids are not exposed; NULL).
    class 
    NEXTVAL function - gets the next value from a sequence Usage: NEXTVAL('sequence_name') or sequence_name.NEXTVAL
    class 
    NO_AGGREGATION_CONSTRAINT() — the AGGREGATION POLICY body that imposes nothing.
    class 
    PROJECTION_CONSTRAINT(ALLOW => <boolean>) — what a PROJECTION POLICY's body returns.
    class 
    SEQ1 / SEQ2 / SEQ4 / SEQ8 — the row's 0-based ordinal, wrapped to the function's integer width.
    class 
    UUID_STRING() — a random version-4 UUID, and UUID_STRING(namespace, name) — the RFC 4122 version-5 name-based form, which is bit-exact with Snowflake.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.conversion

    Modifier and Type
    Class
    Description
    class 
    BINARY_AS_STRING(bin) — the binary input's bytes interpreted as UTF-8 text.
    class 
     
    class 
    DATE(<expr>) — the alias of TO_DATE that ALSO accepts an epoch NUMBER.
    class 
    STRING_AS_BINARY(s) — the string's UTF-8 bytes as BINARY.
    class 
    TIME(<expr>) — the TIME synonym, which is not TO_TIME.
    class 
    TO_BINARY(string [, format]) — decodes the input string into a BinaryValue using format (default HEX).
    class 
     
    class 
     
    class 
     
    class 
    TO_DECFLOAT(expr [, format]) — a 38-digit decimal float on the account, carried here as a DOUBLE, the engine's stand-in for DECFLOAT (a DECFLOAT column is one too).
    class 
    TO_DOUBLE(expr [, format]).
    class 
     
    class 
    TO_TIME(expr [, format]).
    class 
    TO_TIMESTAMP / TO_TIMESTAMP_LTZ / TO_TIMESTAMP_TZ.
    class 
     
    class 
    TO_UUID(s) — the canonical lowercase form of a UUID string.
    class 
    Catalog entry for TRY_CAST.
    class 
    TRY_TO_BINARY(expr [, format]) — the non-throwing form of TO_BINARY: delegates to ToBinary (HEX default / BASE64 / UTF-8) and returns NULL instead of raising when the input cannot be decoded.
    class 
     
    class 
     
    class 
    TRY_TO_DECFLOAT(expr [, format]) — ToDecfloat answering NULL where TO_DECFLOAT fails on the value: a text that spells no number, a format model the text does not fit, and a model that is not one.
    class 
    TRY_TO_DOUBLE(expr [, format]) — ToDouble answering NULL where TO_DOUBLE fails on the value.
    class 
    TRY_TO_NUMBER / TRY_TO_DECIMAL / TRY_TO_NUMERIC — TO_NUMBER's full signature (expr [, format] [, precision, scale]) returning NULL instead of erroring, INCLUDING the scale handling: with no scale the result rounds to a whole number like TO_NUMBER's NUMBER(38,0) default.
    class 
    TRY_TO_TIME(expr [, format]) — the non-throwing form of TO_TIME: delegates to ToTime and returns NULL instead of raising when the input cannot be parsed as a time.
    class 
    TRY_TO_TIMESTAMP / _NTZ / _LTZ / _TZ — the non-throwing form of TO_TIMESTAMP: the same conversion into the same flavour's value (see TimestampFlavourConversion), NULL instead of a refusal for input it cannot read.
    class 
    TRY_TO_UUID(s) — TO_UUID that returns NULL instead of erroring.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.crypto

    Modifier and Type
    Class
    Description
    class 
     
    class 
    DECRYPT_RAW(value, key, iv [, additional_authenticated_data [, encryption_method [, aead_tag]]]) — reverses EncryptRaw.
    class 
    ENCRYPT(value, passphrase [, aad]) — AES-GCM encryption of the value (a string's UTF-8 bytes or a BINARY value's bytes) under a passphrase-derived key.
    class 
    ENCRYPT_RAW(value, key, iv [, additional_authenticated_data [, encryption_method]]) — raw-key AES-GCM authenticated encryption.
    class 
    TRY_DECRYPT — DECRYPT that returns NULL instead of erroring on a bad key or payload.
    class 
    TRY_DECRYPT_RAW — DECRYPT_RAW that returns NULL instead of erroring.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.datetime

    Modifier and Type
    Class
    Description
    class 
    ADD_MONTHS(input, n) — shifts a date or timestamp by n months, preserving end-of-month: an input on the last day of its month lands on the last day of the target month.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    DAYOFWEEKISO(t) — ISO day of week, 1 (Monday) to 7 (Sunday).
    class 
     
    class 
     
    class 
    GETDATE() - the statement's instant in the session's zone, as TIMESTAMP_LTZ.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    NOW() / LOCALTIMESTAMP() — aliases of CURRENT_TIMESTAMP.
    class 
     
    class 
     
    class 
     
    class 
    SYSDATE() — the statement's instant in UTC, as TIMESTAMP_NTZ.
    class 
    SYSTIMESTAMP() - the statement's instant in the session's zone, as TIMESTAMP_LTZ.
    class 
    TIMEADD(unit, amount, datetime) — alias of DATEADD.
    class 
    TIMEDIFF(unit, start, end) — alias of DATEDIFF.
    class 
     
    class 
    TIME_SLICE(t, n, unit [, 'START'|'END']) — the start (default) or end of the n-unit bucket containing t.
    class 
     
    class 
     
    class 
    WEEKISO(t) — ISO-8601 week number.
    class 
     
    class 
     
    class 
    YEAROFWEEK(t) — the year the week belongs to (engine week = ISO week).
    class 
    YEAROFWEEKISO(t) — the ISO week-based year.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.encoding

    Modifier and Type
    Class
    Description
    class 
     
    class 
    BASE64_DECODE_BINARY(string) — decodes a base64 string into a BINARY value.
    class 
    BASE64_ENCODE(expr [, max_line_length [, alphabet]]) — the base64 encoding of the input's bytes.
    class 
    COMPRESS(input, method) — compresses the input (a string's UTF-8 bytes, or a BINARY value's bytes) with method and returns the compressed bytes as BINARY, matching Snowflake's return type.
    class 
    DECOMPRESS_BINARY(input, method) — decompresses a BINARY input and returns the decompressed bytes as BINARY, matching Snowflake's signature.
    class 
    DECOMPRESS_STRING(input, method) — decompresses a BINARY input and returns the bytes as UTF-8 text.
    class 
     
    class 
    HEX_DECODE_BINARY(string) — decodes a hex string into a BINARY value.
    class 
    HEX_ENCODE(expr [, case]) — the hex encoding of the input's bytes, uppercase by default.
    class 
     
    class 
    TRY_BASE64_DECODE_BINARY(string) — BASE64_DECODE_BINARY that returns NULL instead of erroring.
    class 
     
    class 
    TRY_HEX_DECODE_BINARY(string) — HEX_DECODE_BINARY that returns NULL instead of erroring.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.file

    Modifier and Type
    Class
    Description
    class 
    FL_GET_CONTENT_TYPE(file) — the file's MIME content type.
    class 
    FL_GET_ETAG(file) — the staged file's entity tag.
    class 
    FL_GET_FILE_TYPE(file) — the file's single category name: image, video, audio, document, compressed or unknown.
    class 
    FL_GET_LAST_MODIFIED(file) — when the staged file was last modified.
    class 
    FL_GET_RELATIVE_PATH(file) — the file's path within its stage.
    class 
    FL_GET_SCOPED_FILE_URL(file) — the descriptor's SCOPED_FILE_URL field.
    class 
    FL_GET_SIZE(file) — the file's size in bytes.
    class 
    FL_GET_STAGE(file) — the stage the file lives on.
    class 
    FL_GET_STAGE_FILE_URL(file) — the descriptor's STAGE_FILE_URL field.
    class 
    FL_IS_AUDIO(file) — whether the file's CONTENT_TYPE is one of the audio types.
    class 
    FL_IS_COMPRESSED(file) — whether the file's CONTENT_TYPE is one of the archive types.
    class 
    FL_IS_DOCUMENT(file) — whether the file's CONTENT_TYPE is one of the document types.
    class 
    FL_IS_IMAGE(file) — whether the file's CONTENT_TYPE is one of the image types.
    class 
    FL_IS_VIDEO(file) — whether the file's CONTENT_TYPE is one of the video types.
    class 
    TO_FILE(stage_and_path) / TO_FILE(stage, relative_path) / TO_FILE(metadata) — builds the file-metadata object that is a FILE value.
    class 
    TRY_TO_FILE(...) — ToFile with every failure turned into NULL.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.hash

    Modifier and Type
    Class
    Description
    class 
    HASH(expr[, …]) — a deterministic signed 64-bit hash (FNV-1a) over the canonical, type-tagged encoding of its arguments.
    class 
    MD5(msg) — the lowercase hex MD5 digest of the message bytes.
    class 
    MD5_BINARY(msg) — the 16-byte MD5 digest as BINARY.
    class 
     
    class 
     
    class 
     
    class 
    SHA1(msg) — the lowercase hex SHA-1 digest of the message bytes.
    class 
    SHA1_BINARY(msg) — the 20-byte SHA-1 digest as BINARY.
    class 
     
    class 
    SHA2(msg [, bits]) — the lowercase hex SHA-2 digest (256 by default) of the message bytes.
    class 
    SHA2_BINARY(msg [, bits]) — the SHA-2 digest (256 default; 224/384/512) as BINARY.
    class 
     
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.math

    Modifier and Type
    Class
    Description
    class 
    ABS(n) — the absolute value of the numeric input, computed exactly over BigDecimal so a fixed-point argument keeps its scale.
    class 
    ACOS(x) — inverse cosine in radians.
    class 
    ACOSH(x) — inverse hyperbolic cosine, computed as ln(x + sqrt(x*x - 1)) since Math has no acosh.
    class 
     
    class 
    ASINH(x) — inverse hyperbolic sine, computed as ln(x + sqrt(x*x + 1)) since Math has no asinh.
    class 
     
    class 
     
    class 
    ATANH(x) — inverse hyperbolic tangent, computed as 0.5 * ln((1 + x) / (1 - x)) since Math has no atanh.
    class 
     
    class 
    BITCOUNT(n) — the number of set bits in the integer value.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    CEIL(n [, scale]) — the input rounded UP, to whole numbers by default and to scale decimal places when one is given.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    DIV0(a, b) divides like the / operator but returns 0 when the divisor is 0.
    class 
     
    class 
     
    class 
    FLOOR(n [, scale]) — the input rounded DOWN, to whole numbers by default and to scale decimal places when one is given.
    class 
    GETBIT(integer_expr, bit_position) — the value (0 or 1) of the bit at the 0-based bit_position, counting from the least significant bit.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    NEGATE(n) — the negative of the numeric input.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    RANDOM([seed]) — a pseudo-random signed 64-bit integer (not a fraction in [0, 1)).
    class 
    ROUND(n [, scale [, mode]]) — the input rounded to scale decimal places, zero by default.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    UNIFORM(min, max [, gen]) — a uniformly random value in the range.
    class 
    WIDTH_BUCKET(value, min, max, count) — which of count equal buckets between min and max the value falls in, 0 below the range and count + 1 above it.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.semistructured

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

    Modifier and Type
    Class
    Description
    class 
     
    class 
     
    class 
     
    class 
    CHARINDEX(needle, haystack [, start]) — POSITION's argument order; BINARY pairs search by BYTE.
    class 
     
    class 
    COLLATE(expr, 'spec'), also written expr COLLATE 'spec': the string itself, carrying the named collation into whatever compares it.
    class 
    COLLATION(expr): the collation specification expr carries, lower-cased, or NULL when it carries none.
    class 
     
    class 
     
    class 
     
    class 
     
    class 
     
    class 
    ILIKE(subject, pattern) — the function-call form of the subject ILIKE pattern operator (case-INsensitive SQL wildcard match).
    class 
     
    class 
    INSERT(base, position, length, insertion).
    class 
    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.
    class 
    LEFT(expr, n) — the leading n characters of a VARCHAR, or the leading n BYTES of a BINARY.
    class 
     
    class 
     
    class 
    LIKE(subject, pattern) — the function-call form of the subject LIKE pattern operator (case-sensitive SQL wildcard match, % = any run, _ = one char).
    class 
     
    class 
    LPAD(expr, len [, pad]) — a VARCHAR padded to len characters, or a BINARY padded to len BYTES.
    class 
     
    class 
    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).
    class 
     
    class 
    PARSE_IP(ip_address, type [, permissive]) — parses an IPv4/IPv6 address (optionally in CIDR addr/prefix form) into a VARIANT OBJECT, matching Snowflake.
    class 
    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.
    class 
    POSITION(needle, haystack [, start]) — the 1-based position of needle, or 0 when absent.
    class 
    RANDSTR(length, generator) — a deterministic random alphanumeric string seeded by the generator.
    class 
    REGEXP_COUNT(subject, pattern [, position [, parameters]]) — the number of matches of pattern at or after position (1-based, default 1).
    class 
    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.
    class 
    REGEXP_LIKE(subject, pattern [, parameters]) — TRUE when pattern matches the ENTIRE subject (implicitly anchored, as in Snowflake).
    class 
    REGEXP_REPLACE(subject, pattern [, replacement [, position [, occurrence [, parameters]]]]) — replace matches of pattern with replacement.
    class 
    REGEXP_SUBSTR(subject, pattern [, position [, occurrence [, parameters [, group_num]]]]) — the occurrence-th match (default 1) at or after position (1-based, default 1).
    class 
    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).
    class 
    REPEAT(s, n): the string n times over, NULL when either argument is NULL.
    class 
     
    class 
    REVERSE(expr) — a VARCHAR reversed by characters, or a BINARY reversed by BYTES.
    class 
    RIGHT(expr, n) — the trailing n characters of a VARCHAR, or the trailing n BYTES of a BINARY.
    class 
    RPAD(expr, len [, pad]) — a VARCHAR padded to len characters, or a BINARY padded to len BYTES.
    class 
     
    class 
    RTRIMMED_LENGTH(s) — the length of the string without trailing blanks.
    class 
    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.
    class 
     
    class 
    SPACE(n): n blanks.
    class 
    SPLIT(string, delimiter) — splits string on the literal delimiter into an ARRAY of substrings (rendered as a JSON array, the engine's VARIANT representation).
    class 
     
    class 
     
    class 
     
    class 
    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.
    class 
    SUBSTRING(expr, start [, length]) — a slice of a VARCHAR by characters or of a BINARY by BYTES.
    class 
     
    class 
     
    class 
    TRY_PARSE_IP — PARSE_IP that returns NULL instead of erroring on invalid input.
    class 
    TRY_VALIDATE_UTF8(x) — the input as a string when its bytes are valid UTF-8, else NULL.
    class 
     
    class 
     
    class 
    VALIDATE_UTF8(x) — the input as a string when its bytes are valid UTF-8.
  • Uses of BuiltInFunction in dev.frostlake.functions.scalar.vector

    Modifier and Type
    Class
    Description
    class 
    IS_VECTOR(x) — TRUE when the value is a VECTOR, FALSE for every other value VARIANT can hold.
    class 
    VECTOR_COSINE_SIMILARITY(v1, v2) — the cosine of the angle between two vectors, Σ(a·b) / (|a|·|b|), as a FLOAT (float64).
    class 
    VECTOR_INNER_PRODUCT(v1, v2) — the dot product Σ(a·b), as a FLOAT (float64).
    class 
    VECTOR_L1_DISTANCE(v1, v2) — the Manhattan distance Σ|a−b|, as a FLOAT (float64).
    class 
    VECTOR_L2_DISTANCE(v1, v2) — the Euclidean distance sqrt(Σ(a−b)²), as a FLOAT (float64).
    class 
    VECTOR_NORMALIZE(v) — the unit vector v / |v|, always a VECTOR(FLOAT, n).
    class 
    VECTOR_TRUNC(v, n) (alias VECTOR_TRUNCATE) — the vector's FIRST n dimensions, keeping the element type.