Package dev.frostlake.functions
package dev.frostlake.functions
-
ClassDescriptionBase class for aggregate functions (SUM, COUNT, LISTAGG, …).The running state of one aggregate over one group: values are folded in one row at a time and the group's result is read out at the end.Text matching under a collation, for the functions that compare rather than merely carry one: CONTAINS, STARTSWITH, ENDSWITH, POSITION, CHARINDEX, REPLACE, SPLIT and SPLIT_PART all look for a substring the collation calls equal, not one that matches byte for byte.ServiceLoader SPI for optional function packs.The higher-order functions — the ones whose last argument is a lambda, so the argument must NOT be pre-evaluated.Raised by a function that ORDERS its arguments when two of them belong to families it cannot bring together —
GREATEST(<binary>, <string>)and its kin.How an accumulator that needs more than one argument per row receives them.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 ofTextArgumentFunction, and the same live message shape ("Invalid argument types for function 'ABS': (OBJECT)", SQLSTATE 42P13).Built-in function names Snowflake gives to operators and grammar forms rather than to callable functions —+,IS NULL,||,LIKE_ANY,COUNT(*), … A real account lists all of them inSHOW BUILTIN FUNCTIONS(the 30 non-word names it returns are!= % * + - / : < <= <> = > >= COUNT(*) COUNT_INTERNAL(*) [] ||, the fourINTERVAL …arithmetic entries,IS NULL,IS NOT NULL,OBJECT_CONSTRUCT(*),OBJECT_CONSTRUCT_KEEP_NULL(*)andOBJECT_CONSTRUCT_KEEP_NULL_STRUCTURED(*), alongside word-shaped operator names such asAND,OR,NOT,BETWEEN,IN,LIKE_ANYandDIV).HOW a built-in refuses a statically OBJECT- or ARRAY-typed argument.A 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.How many arguments the SYSTEM$ functions take.TheSYSTEM$built-ins the engine evaluates itself.Interface for table-valued functionsA built-in that reads its arguments as text, and therefore refuses a statically OBJECT- or ARRAY-typed value in EVERY argument position.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.