Package dev.frostlake.functions.scalar
package dev.frostlake.functions.scalar
-
ClassesClassDescriptionShared helpers for array/object scalar functions.Snowflake's AUTO date/time input detection: a lenient field scanner for the timestamp and date forms Snowflake accepts without an explicit format model.Small shared helper for the date/time functions.One piece of a Snowflake date/time format model after the scan: either an ELEMENT — the canonical upper-case spelling of a recognised element (YYYY, MON, HH24, FF3, TZH:TZM, …) — or a run of LITERAL text: separators, unrecognised letters, the contents of a double-quoted run.GROUPING(col) — returns 1 if the column is aggregated (NULL due to ROLLUP/CUBE), 0 if the column participates in grouping for this row.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.Array HOLES — the elisions a JSON array may be written with, which Snowflake reads as
undefinedelements instead of refusing the document.The BARE WORDS a JSON document may carry, and the one thing that tells them apart: a word with a COLON after it is an attribute NAME, and any other word is a KEYWORD.Which JSON numbers belong to the DOUBLE family, decided by HOW THEY WERE WRITTEN.Shared utilities for JSON variant type-checking functions.Formats a temporal value with a subset of Snowflake's date/time format model (TO_CHAR / TO_VARCHAR with a date format).Reads a string against an explicit Snowflake date/time format model — TO_DATE / TO_TIME / TO_TIMESTAMP* with a format argument — the way the account does, and refuses the way it does:Can't parse '<input>' as date|time|timestamp with format '<format>', both echoed verbatim (the input with its own spaces, the format with its quotes).Formats a numeric value with Snowflake's SQL number format model (used by TO_CHAR / TO_VARCHAR with a numeric format string), matching the live-verified output shape: the result is RIGHT-ALIGNED to the template width plus one leading sign position (blank for positive, a floating-for negative,+/-with a leadingS);MImoves the sign to a trailing position (-or blank) with no leading sign slot; a$floats between the sign and the digits;0placeholders zero-pad; trailing fractional9positions render insignificant zeros as spaces (0.5with'99.99'is" 0.5 "); a value wider than the integer template renders#across the template width;FMstrips all of that padding.