Uses of Class
dev.frostlake.functions.BuiltInFunction
Packages that use BuiltInFunction
Package
Description
-
Uses of BuiltInFunction in dev.frostlake.functions
Subclasses of BuiltInFunction in dev.frostlake.functionsModifier and TypeClassDescriptionclassBase class for aggregate functions (SUM, COUNT, LISTAGG, …).classA 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 ofTextArgumentFunction, and the same live message shape ("Invalid argument types for function 'ABS': (OBJECT)", SQLSTATE 42P13).classA built-in that reads its argument as a VARIANT and therefore refuses a STRUCTURED one — anOBJECT(x VARCHAR), anARRAY(INT)or aMAP(VARCHAR, INT)— in EVERY argument position, while taking the plain semi-structured OBJECT and ARRAY happily.classA built-in that reads its arguments as text, and therefore refuses a statically OBJECT- or ARRAY-typed value in EVERY argument position.classA 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.Methods in dev.frostlake.functions that return BuiltInFunctionMethods in dev.frostlake.functions that return types with arguments of type BuiltInFunctionMethods in dev.frostlake.functions with parameters of type BuiltInFunctionModifier and TypeMethodDescriptionvoidFunctionRegistry.register(BuiltInFunction function) voidFunctionRegistry.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
Subclasses of BuiltInFunction in dev.frostlake.functions.aggregateModifier and TypeClassDescriptionclassANY_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.classAPPROX_COUNT_DISTINCT(expr) — an approximate count of the distinct non-NULL values in the group, estimated with theHllAccumulatorHyperLogLog sketch (~0.8% standard error, near-exact at low cardinality).classAPPROX_PERCENTILE(expr, percentile) — the approximate value at the given percentile (a constant in [0, 1]) ofexpr.classAPPROX_PERCENTILE_ACCUMULATE(expr): thePercentileDigestof a numeric input as an OBJECT state, for APPROX_PERCENTILE_COMBINE to merge and APPROX_PERCENTILE_ESTIMATE to read.classAPPROX_PERCENTILE_COMBINE(state): the APPROX_PERCENTILE_ACCUMULATE states of its input merged into one digest — every centroid kept with its weight, sorted by mean.classAPPROX_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 (seePercentileDigestfor the weighted reading of a hand-written state).classAPPROX_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 inTopKSummaryovercounterscounters (default 100000; k defaults to 1).classAPPROX_TOP_K_ACCUMULATE(expr, counters): the wholeTopKSummaryof 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.classAPPROX_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 tocounters(a constant between 1 and 100000; by default the inputs' own limit, which every input must share: differing limits refuse withInvalid parameter value: ApproxTopK state. Reason: combining states with different numbers of counters).classAPPROX_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).classclassARRAY_UNION_AGG(array) — an aggregate whose every input row is itself an ARRAY.classARRAY_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.classAVG(expr) — seeAvgAccumulator/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).classclassclassclassclassThe three boolean aggregates' shared argument rule.classclassclassclassclassclassclassclassHASH_AGG(expr) — a single, order-INDEPENDENT signed 64-bit hash over the whole (multi)set of input rows.classclassLISTAGG(<expr> [, <delimiter>]) — concatenate values into a single string.classclassMAX_BY(value, sort_key) — a two-argument aggregate returning thevaluefrom the row whosesort_keyis the maximum.classclassclassMIN_BY(value, sort_key) — a two-argument aggregate returning thevaluefrom the row whosesort_keyis the minimum.classclassOBJECT_AGG(key, value) — aggregates key/value pairs into a single OBJECT.classclassclassREGR_AVGX(y, x) — average of the independent variable x over non-null (y, x) pairs (y dependent, x independent).classREGR_AVGY(y, x) — average of the dependent variable y over non-null (y, x) pairs (y dependent, x independent).classREGR_COUNT(y, x) — count over non-null (y, x) pairs (y dependent, x independent).classREGR_INTERCEPT(y, x) — y-intercept of the least-squares regression line over non-null (y, x) pairs (y dependent, x independent).classREGR_R2(y, x) — coefficient of determination (R squared) over non-null (y, x) pairs (y dependent, x independent).classREGR_SLOPE(y, x) — slope of the least-squares regression line over non-null (y, x) pairs (y dependent, x independent).classREGR_SXX(y, x) — sum of squares of x deviations over non-null (y, x) pairs (y dependent, x independent).classREGR_SXY(y, x) — sum of products of x and y deviations over non-null (y, x) pairs (y dependent, x independent).classREGR_SYY(y, x) — sum of squares of y deviations over non-null (y, x) pairs (y dependent, x independent).classclassclassclassclassclassclassclassclassVECTOR_AVG(v)— the element-wise MEAN of a group's vectors, always aVECTOR(FLOAT, n): over the rows[1,2,3]and[4,5,6]it is[2.5,3.5,4.5](live-verified).classVECTOR_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.classVECTOR_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.classVECTOR_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
Subclasses of BuiltInFunction in dev.frostlake.functions.scalarModifier and TypeClassDescriptionclassGROUPING(col) — returns 1 if the column is aggregated (NULL due to ROLLUP/CUBE), 0 if the column participates in grouping for this row.classGROUPING_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
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.conditionalModifier and TypeClassDescriptionclassBOOLAND(expr1, expr2) — three-valued logical AND over numeric/boolean inputs (non-zero is TRUE, zero is FALSE).classBOOLNOT(expr1) — three-valued logical NOT over a numeric/boolean input (non-zero is TRUE, zero is FALSE).classBOOLOR(expr1, expr2) — three-valued logical OR over numeric/boolean inputs (non-zero is TRUE, zero is FALSE).classBOOLXOR(expr1, expr2) — three-valued logical exclusive-OR over numeric/boolean inputs (non-zero is TRUE, zero is FALSE).classclassDECODE(expr, search1, result1 [, search2, result2 ...] [, default]) Like a searched CASE: compares expr to each search value and returns the matching result.classEQUAL_NULL(a, b) — NULL-safe equality: returns TRUE if both NULL, TRUE if equal, FALSE otherwise.classclassGREATEST_IGNORE_NULLS — the largest non-NULL argument, IGNORING NULLs (Snowflake's explicit skipping variant; plain LEAST/GREATEST return NULL when any argument is NULL).classclassclassclassLEAST_IGNORE_NULLS — the smallest non-NULL argument, IGNORING NULLs (Snowflake's explicit skipping variant; plain LEAST/GREATEST return NULL when any argument is NULL).classclassclassclassNVL2(expr1, expr2, expr3) — returns expr2 when expr1 is NOT NULL, otherwise expr3.classREGR_VALX(y, x) — x when BOTH arguments are non-NULL, else NULL.classREGR_VALY(y, x) — y when BOTH arguments are non-NULL, else NULL.classZEROIFNULL 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
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.contextModifier and TypeClassDescriptionclassAGGREGATION_CONSTRAINT(MIN_GROUP_SIZE => n)— the minimum group size an AGGREGATION POLICY imposes.classCURRENT_ACCOUNT() function - returns the account identifier The account ID can be configured in the frostlake.properties file with the key 'account.id'classCURRENT_ACCOUNT_NAME() — the account's NAME, configured throughaccount.name.classCURRENT_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.classCURRENT_CLIENT() — the identifier of the client library the session is connecting through.classclassclassCURRENT_IP_ADDRESS() — the client IP address (loopback for the embedded engine).classCURRENT_ORGANIZATION_NAME() — the organization the account belongs to, configured throughorganization.name.classclassclassCURRENT_ROLE_TYPE() — the current role type (always an account-level ROLE here).classclassCURRENT_SCHEMAS() — the active search path as a JSON array of the current schema.classCURRENT_SECONDARY_ROLES() — the active secondary roles (none in the embedded engine).classclassCURRENT_STATEMENT() — the text of the statement being executed, from the session.classclassclassCURRENT_TRANSACTION() — the open transaction id (ids are not exposed; NULL, as Snowflake returns outside a transaction).classclassCURRENT_VERSION() — the version of the running engine, taken fromBuildInfo.version()so it tracks the built artifact.classclassGET_DDL('<object_type>', '<object_name>' [, <use_fully_qualified_names>])— reconstructs aCREATE OR REPLACEstatement for an object from the catalog.classINVOKER_ROLE() — the invoking role (the current role in the embedded engine).classIS_ROLE_IN_SESSION(name) — TRUE when the named role is the session's current role.classJOIN_CONSTRAINT(JOIN_REQUIRED => <boolean>)— what a JOIN POLICY's body returns.classLAST_QUERY_ID() function - returns the query ID of the last executed queryclassLAST_TRANSACTION() — the last transaction id (ids are not exposed; NULL).classNEXTVAL function - gets the next value from a sequence Usage: NEXTVAL('sequence_name') or sequence_name.NEXTVALclassNO_AGGREGATION_CONSTRAINT()— the AGGREGATION POLICY body that imposes nothing.classPROJECTION_CONSTRAINT(ALLOW => <boolean>)— what a PROJECTION POLICY's body returns.classSEQ1 / SEQ2 / SEQ4 / SEQ8 — the row's 0-based ordinal, wrapped to the function's integer width.classUUID_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
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.conversionModifier and TypeClassDescriptionclassBINARY_AS_STRING(bin) — the binary input's bytes interpreted as UTF-8 text.classclassDATE(<expr>)— the alias of TO_DATE that ALSO accepts an epoch NUMBER.classSTRING_AS_BINARY(s) — the string's UTF-8 bytes as BINARY.classTIME(<expr>)— the TIME synonym, which is not TO_TIME.classTO_BINARY(string [, format]) — decodes the input string into aBinaryValueusingformat(default HEX).classclassclassclassTO_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).classTO_DOUBLE(expr [, format]).classclassTO_TIME(expr [, format]).classTO_TIMESTAMP / TO_TIMESTAMP_LTZ / TO_TIMESTAMP_TZ.classclassTO_UUID(s) — the canonical lowercase form of a UUID string.classCatalog entry for TRY_CAST.classTRY_TO_BINARY(expr [, format]) — the non-throwing form of TO_BINARY: delegates toToBinary(HEX default / BASE64 / UTF-8) and returns NULL instead of raising when the input cannot be decoded.classclassclassTRY_TO_DECFLOAT(expr [, format]) —ToDecfloatanswering 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.classTRY_TO_DOUBLE(expr [, format]) —ToDoubleanswering NULL where TO_DOUBLE fails on the value.classTRY_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.classTRY_TO_TIME(expr [, format]) — the non-throwing form of TO_TIME: delegates toToTimeand returns NULL instead of raising when the input cannot be parsed as a time.classTRY_TO_TIMESTAMP / _NTZ / _LTZ / _TZ — the non-throwing form of TO_TIMESTAMP: the same conversion into the same flavour's value (seeTimestampFlavourConversion), NULL instead of a refusal for input it cannot read.classTRY_TO_UUID(s) — TO_UUID that returns NULL instead of erroring. -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.crypto
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.cryptoModifier and TypeClassDescriptionclassclassDECRYPT_RAW(value, key, iv [, additional_authenticated_data [, encryption_method [, aead_tag]]]) — reversesEncryptRaw.classENCRYPT(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.classENCRYPT_RAW(value, key, iv [, additional_authenticated_data [, encryption_method]]) — raw-key AES-GCM authenticated encryption.classTRY_DECRYPT — DECRYPT that returns NULL instead of erroring on a bad key or payload.classTRY_DECRYPT_RAW — DECRYPT_RAW that returns NULL instead of erroring. -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.datetime
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.datetimeModifier and TypeClassDescriptionclassADD_MONTHS(input, n) — shifts a date or timestamp bynmonths, preserving end-of-month: an input on the last day of its month lands on the last day of the target month.classclassclassclassclassclassclassclassclassclassDAYOFWEEKISO(t) — ISO day of week, 1 (Monday) to 7 (Sunday).classclassclassGETDATE() - the statement's instant in the session's zone, as TIMESTAMP_LTZ.classclassclassclassclassclassclassclassNOW() / LOCALTIMESTAMP() — aliases of CURRENT_TIMESTAMP.classclassclassclassSYSDATE() — the statement's instant in UTC, as TIMESTAMP_NTZ.classSYSTIMESTAMP() - the statement's instant in the session's zone, as TIMESTAMP_LTZ.classTIMEADD(unit, amount, datetime) — alias of DATEADD.classTIMEDIFF(unit, start, end) — alias of DATEDIFF.classclassTIME_SLICE(t, n, unit [, 'START'|'END']) — the start (default) or end of the n-unit bucket containing t.classclassclassWEEKISO(t) — ISO-8601 week number.classclassclassYEAROFWEEK(t) — the year the week belongs to (engine week = ISO week).classYEAROFWEEKISO(t) — the ISO week-based year. -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.encoding
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.encodingModifier and TypeClassDescriptionclassclassBASE64_DECODE_BINARY(string) — decodes a base64 string into a BINARY value.classBASE64_ENCODE(expr [, max_line_length [, alphabet]]) — the base64 encoding of the input's bytes.classCOMPRESS(input, method) — compresses the input (a string's UTF-8 bytes, or a BINARY value's bytes) withmethodand returns the compressed bytes as BINARY, matching Snowflake's return type.classDECOMPRESS_BINARY(input, method) — decompresses a BINARY input and returns the decompressed bytes as BINARY, matching Snowflake's signature.classDECOMPRESS_STRING(input, method) — decompresses a BINARY input and returns the bytes as UTF-8 text.classclassHEX_DECODE_BINARY(string) — decodes a hex string into a BINARY value.classHEX_ENCODE(expr [, case]) — the hex encoding of the input's bytes, uppercase by default.classclassTRY_BASE64_DECODE_BINARY(string) — BASE64_DECODE_BINARY that returns NULL instead of erroring.classclassTRY_HEX_DECODE_BINARY(string) — HEX_DECODE_BINARY that returns NULL instead of erroring. -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.file
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.fileModifier and TypeClassDescriptionclassFL_GET_CONTENT_TYPE(file)— the file's MIME content type.classFL_GET_ETAG(file)— the staged file's entity tag.classFL_GET_FILE_TYPE(file)— the file's single category name:image,video,audio,document,compressedorunknown.classFL_GET_LAST_MODIFIED(file)— when the staged file was last modified.classFL_GET_RELATIVE_PATH(file)— the file's path within its stage.classFL_GET_SCOPED_FILE_URL(file)— the descriptor'sSCOPED_FILE_URLfield.classFL_GET_SIZE(file)— the file's size in bytes.classFL_GET_STAGE(file)— the stage the file lives on.classFL_GET_STAGE_FILE_URL(file)— the descriptor'sSTAGE_FILE_URLfield.classFL_IS_AUDIO(file)— whether the file'sCONTENT_TYPEis one of the audio types.classFL_IS_COMPRESSED(file)— whether the file'sCONTENT_TYPEis one of the archive types.classFL_IS_DOCUMENT(file)— whether the file'sCONTENT_TYPEis one of the document types.classFL_IS_IMAGE(file)— whether the file'sCONTENT_TYPEis one of the image types.classFL_IS_VIDEO(file)— whether the file'sCONTENT_TYPEis one of the video types.classTO_FILE(stage_and_path)/TO_FILE(stage, relative_path)/TO_FILE(metadata)— builds the file-metadata object that is a FILE value.classTRY_TO_FILE(...)—ToFilewith every failure turned into NULL. -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.hash
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.hashModifier and TypeClassDescriptionclassHASH(expr[, …]) — a deterministic signed 64-bit hash (FNV-1a) over the canonical, type-tagged encoding of its arguments.classMD5(msg) — the lowercase hex MD5 digest of the message bytes.classMD5_BINARY(msg) — the 16-byte MD5 digest as BINARY.classclassclassclassSHA1(msg) — the lowercase hex SHA-1 digest of the message bytes.classSHA1_BINARY(msg) — the 20-byte SHA-1 digest as BINARY.classclassSHA2(msg [, bits]) — the lowercase hex SHA-2 digest (256 by default) of the message bytes.classSHA2_BINARY(msg [, bits]) — the SHA-2 digest (256 default; 224/384/512) as BINARY.class -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.math
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.mathModifier and TypeClassDescriptionclassABS(n) — the absolute value of the numeric input, computed exactly overBigDecimalso a fixed-point argument keeps its scale.classACOS(x) — inverse cosine in radians.classclassclassclassclassclassATANH(x) — inverse hyperbolic tangent, computed as0.5 * ln((1 + x) / (1 - x))sinceMathhas noatanh.classclassBITCOUNT(n) — the number of set bits in the integer value.classclassclassclassclassclassclassCEIL(n [, scale]) — the input rounded UP, to whole numbers by default and toscaledecimal places when one is given.classclassclassclassclassDIV0(a, b) divides like the/operator but returns 0 when the divisor is 0.classclassclassFLOOR(n [, scale]) — the input rounded DOWN, to whole numbers by default and toscaledecimal places when one is given.classGETBIT(integer_expr, bit_position) — the value (0 or 1) of the bit at the 0-basedbit_position, counting from the least significant bit.classclassclassclassclassNEGATE(n) — the negative of the numeric input.classclassclassclassclassRANDOM([seed]) — a pseudo-random signed 64-bit integer (not a fraction in [0, 1)).classROUND(n [, scale [, mode]]) — the input rounded toscaledecimal places, zero by default.classclassclassclassclassclassclassclassclassUNIFORM(min, max [, gen]) — a uniformly random value in the range.classWIDTH_BUCKET(value, min, max, count) — which ofcountequal buckets betweenminandmaxthe value falls in, 0 below the range andcount + 1above it. -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.semistructured
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.semistructuredModifier and TypeClassDescriptionclassARRAY_APPEND(array, value) — appends value to array and returns the new array.classARRAY_CAT(array1, array2) — concatenates two arrays.classARRAY_COMPACT(array) — returns the array with all null elements removed.classARRAY_CONSTRUCT(val1, val2, ...) — builds a JSON array from the given values.classARRAY_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).classARRAY_CONTAINS(value, array) — returns TRUE if the array contains the value.classARRAY_DISTINCT(array) — removes duplicate elements.classARRAY_EXCEPT(array1, array2) — the MULTISET difference: max(0, N-M) copies of each element.classARRAY_FLATTEN(array) — flattens one level of nested arrays.classARRAY_GENERATE_RANGE(start, stop [, step]) — an array of integers from start (inclusive) to stop (EXCLUSIVE). step defaults to 1 and may be negative.classARRAY_INSERT(array, pos, element) — inserts element at 0-based index pos, shifting later elements right.classARRAY_INTERSECTION(array1, array2) — the MULTISET intersection: min(N, M) copies of each element.classARRAY_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.classARRAY_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.classARRAY_POSITION(value, array) — 0-based index of the first element equal to value, or NULL.classARRAY_PREPEND(array, value) — prepends value to the front of the array.classARRAY_REMOVE(array, value) — removes all occurrences of value from array.classARRAY_REMOVE_AT(array, index) — removes element at given index (0-based).classARRAY_REPEAT(value, n) — an array of n copies of the value.classARRAY_REVERSE(array) — returns the array with its elements in reverse order.classARRAY_SIZE(array) — returns the number of elements.classARRAY_SLICE(array, from, to) — returns a sub-array from index `from` (inclusive) to `to` (exclusive).classARRAY_SORT(array [, sort_ascending [, nulls_first]]) — sorts elements. sort_ascending defaults to TRUE.classARRAYS_OVERLAP(array1, array2) — returns TRUE if the arrays share at least one element.classARRAYS_TO_OBJECT(keys, values) — an object pairing the key array with the value array by index.classARRAYS_ZIP(a1, a2, …) — an array of objects pairing same-index elements under keys $1, $2, ….classARRAY_TO_STRING(array, delimiter) — joins array elements with a delimiter.classclassAS_BINARY(v) — the value when it is BINARY, else NULL (the engine's variant model carries no binary members).classclassAS_DATE(v) — the value when it is a DATE, else NULL (variant members carry dates as text).classAS_DECIMAL(v [, precision [, scale]]) — the variant's numeric value as a fixed-point number rounded (HALF_UP) to the given scale, else NULL.classclassclassclassAS_TIME(v) — the value when it is a TIME, else NULL.classAS_TIMESTAMP_NTZ(v) — the value when it is a TIMESTAMP, else NULL (LTZ/TZ alias here too).classclassCHECK_JSON(str) — returns NULL if valid JSON, otherwise an error description string.classCHECK_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).classGET_IGNORE_CASE(obj, key) — like GET but matches object keys case-insensitively.classGET(object_or_array, field_or_index) — extracts a value by key (object) or index (array).classclassIS_BINARY(v) — TRUE when the value is BINARY (never true for variant members in this engine's model).classclassIS_DATE(v) — TRUE when the value is a DATE (variant members carry dates as text, so those are FALSE).classIS_DECIMAL(v) — TRUE when the variant holds a fixed-point number (integral or decimal node).classIS_DOUBLE(v) — TRUE when the variant holds any number (Snowflake: DOUBLE, INTEGER or DECIMAL).classclassclassclassIS_TIME(v) — TRUE when the value is a TIME.classIS_TIMESTAMP_NTZ(v) — TRUE when the value is a TIMESTAMP (LTZ/TZ alias here; the engine models all as NTZ).classclassJSON_EXTRACT_PATH_TEXT(json, path) — parses the JSON text and returns the path's value as unquoted text.classMAP_CAT(map1, map2) — the concatenation (merge) of two MAPs.classMAP_CONSTRUCT(key, value [, key, value …]) — a MAP built from alternating key/value arguments.classMAP_CONTAINS_KEY(key, map) — whether the map holds the key.classMAP_DELETE(map, key [, key …]) — the map without the named keys.classMAP_ENTRIES(map) — the map's entries as an array of{"key": …, "value": …}objects, in key order.classMAP_INSERT(map, key, value [, updateFlag]) — the map with one entry added or replaced.classMAP_KEYS(map) — the map's keys as an array, in key order.classMAP_PICK(map, key [, key …]) and MAP_PICK(map, keyArray) — the map narrowed to the named keys.classMAP_SIZE(map) — the number of entries.classOBJECT_CONSTRUCT(k1, v1, k2, v2, ...) — builds an object from key-value pairs.classclassOBJECT_DELETE(object, key1 [, key2, ...]) — removes one or more keys from an object.classOBJECT_INSERT(object, key, value [, update_flag]) — inserts/updates a key in an object.classOBJECT_KEYS(object) — returns an array of the object's keys.classOBJECT_PICK(object, key1 [, key2, ...]) — returns an object with only the specified keys.classclassPARSE_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.classclassTO_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.classclassTO_OBJECT(expr) — NULL (or JSON null) returns NULL; an OBJECT (or a VARIANT containing an OBJECT) is returned as an object.classTO_VARIANT(expr) — wraps a value as a typed VARIANT.classTO_XML(variant) — the XML text of a semi-structured value.classclassclassXMLGET(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). -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.string
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.stringModifier and TypeClassDescriptionclassclassclassclassCHARINDEX(needle, haystack [, start]) — POSITION's argument order; BINARY pairs search by BYTE.classclassCOLLATE(expr, 'spec'), also writtenexpr COLLATE 'spec': the string itself, carrying the named collation into whatever compares it.classCOLLATION(expr): the collation specificationexprcarries, lower-cased, or NULL when it carries none.classclassclassclassclassclassILIKE(subject, pattern) — the function-call form of thesubject ILIKE patternoperator (case-INsensitive SQL wildcard match).classclassINSERT(base, position, length, insertion).classJAROWINKLER_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.classLEFT(expr, n) — the leading n characters of a VARCHAR, or the leading n BYTES of a BINARY.classclassclassLIKE(subject, pattern) — the function-call form of thesubject LIKE patternoperator (case-sensitive SQL wildcard match,%= any run,_= one char).classclassLPAD(expr, len [, pad]) — a VARCHAR padded to len characters, or a BINARY padded to len BYTES.classclassNORMALIZE(x, lo, hi) — Snowflake's min-max normalization(x - lo) / (hi - lo), NOT Unicode normalization (live-verified:NORMALIZE(5, 0, 10)is 0.5).classclassPARSE_IP(ip_address, type [, permissive]) — parses an IPv4/IPv6 address (optionally in CIDRaddr/prefixform) into a VARIANT OBJECT, matching Snowflake.classPARSE_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.classPOSITION(needle, haystack [, start]) — the 1-based position of needle, or 0 when absent.classRANDSTR(length, generator) — a deterministic random alphanumeric string seeded by the generator.classREGEXP_COUNT(subject, pattern [, position [, parameters]]) — the number of matches ofpatternat or afterposition(1-based, default 1).classREGEXP_INSTR(subject, pattern [, position [, occurrence [, option [, parameters [, group_num]]]]]) — the 1-based position of theoccurrence-th match (default 1) at or afterposition(default 1), or 0 when there is none.classREGEXP_LIKE(subject, pattern [, parameters]) — TRUE whenpatternmatches the ENTIRE subject (implicitly anchored, as in Snowflake).classREGEXP_REPLACE(subject, pattern [, replacement [, position [, occurrence [, parameters]]]]) — replace matches ofpatternwithreplacement.classREGEXP_SUBSTR(subject, pattern [, position [, occurrence [, parameters [, group_num]]]]) — theoccurrence-th match (default 1) at or afterposition(1-based, default 1).classREGEXP_SUBSTR_ALL(subject, pattern [, position [, occurrence [, parameters [, group_num]]]]) — returns a VARIANT ARRAY with an element for every match at or afterposition(1-based, default 1), starting from theoccurrence-th match (default 1).classREPEAT(s, n): the stringntimes over, NULL when either argument is NULL.classclassREVERSE(expr) — a VARCHAR reversed by characters, or a BINARY reversed by BYTES.classRIGHT(expr, n) — the trailing n characters of a VARCHAR, or the trailing n BYTES of a BINARY.classRPAD(expr, len [, pad]) — a VARCHAR padded to len characters, or a BINARY padded to len BYTES.classclassRTRIMMED_LENGTH(s) — the length of the string without trailing blanks.classSEARCH(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.classclassSPACE(n):nblanks.classSPLIT(string, delimiter) — splitsstringon the literaldelimiterinto an ARRAY of substrings (rendered as a JSON array, the engine's VARIANT representation).classclassclassclassSTRTOK_TO_ARRAY(string [, delimiters]) — tokenizesstringon any character indelimiters(each character is its own delimiter; the default is a single space) and returns a VARIANT ARRAY of the non-empty tokens.classSUBSTRING(expr, start [, length]) — a slice of a VARCHAR by characters or of a BINARY by BYTES.classclassclassTRY_PARSE_IP — PARSE_IP that returns NULL instead of erroring on invalid input.classTRY_VALIDATE_UTF8(x) — the input as a string when its bytes are valid UTF-8, else NULL.classclassclassVALIDATE_UTF8(x) — the input as a string when its bytes are valid UTF-8. -
Uses of BuiltInFunction in dev.frostlake.functions.scalar.vector
Subclasses of BuiltInFunction in dev.frostlake.functions.scalar.vectorModifier and TypeClassDescriptionclassIS_VECTOR(x)— TRUE when the value is a VECTOR, FALSE for every other value VARIANT can hold.classVECTOR_COSINE_SIMILARITY(v1, v2)— the cosine of the angle between two vectors,Σ(a·b) / (|a|·|b|), as a FLOAT (float64).classVECTOR_INNER_PRODUCT(v1, v2)— the dot productΣ(a·b), as a FLOAT (float64).classVECTOR_L1_DISTANCE(v1, v2)— the Manhattan distanceΣ|a−b|, as a FLOAT (float64).classVECTOR_L2_DISTANCE(v1, v2)— the Euclidean distancesqrt(Σ(a−b)²), as a FLOAT (float64).classVECTOR_NORMALIZE(v)— the unit vectorv / |v|, always aVECTOR(FLOAT, n).classVECTOR_TRUNC(v, n)(aliasVECTOR_TRUNCATE) — the vector's FIRSTndimensions, keeping the element type.