All Classes and Interfaces
Class
Description
ABS(n) — the absolute value of the numeric input, computed exactly over
BigDecimal so a
fixed-point argument keeps its scale.Abstract base class for demo applications
Provides common functionality for engine management, output formatting, and database operations
Who this engine says it is: one organization, one account, one region — assembled once and read by
everything that reports any of it, so the same fact cannot be spelled three different ways.
ACOS(x) — inverse cosine in radians.
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.Cache key for statement-invariant facts of the generic aggregate path: a kind tag, up to three
CONTEXT objects compared by reference IDENTITY (a new table / context object means a new key, so
no explicit clearing is needed across statements), and the argument text.
Interface for evaluating a SELECT-list item (aggregate or grouped projection) on a group of rows,
identified by its position in the operator's select-expression list (not by text).
Base 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.
Stateless aggregate-evaluation helpers extracted from
QueryExecutor: WITHIN GROUP parsing,
PERCENTILE_CONT/DISC evaluation, and the simple aggregate value reducer.Numeric helpers shared by every SUM / AVG code path (the fast-path plan, the general grouped evaluator,
the generic dispatch, the accumulators and the window frame).
An aggregate's value that its declared type cannot hold — live's row-time "Number out of
representable range: type FIXED[SB16](38,38){nullable}, value 3", raised where the DECLARED type is
still a legal NUMBER but the value written into it is not: MEDIAN over a NUMBER(38,35) declares
NUMBER(38,38), and a median of 3 has no room there.
AGGREGATION_CONSTRAINT(MIN_GROUP_SIZE => n) — the minimum group size an AGGREGATION POLICY
imposes.Snowflake AGGREGATION POLICY — attached to a TABLE, it forbids reading individual rows: a query must
aggregate, may not use the aggregates that would leak a single value (MIN, MAX, MEDIAN, MODE,
ANY_VALUE, VARIANCE, LISTAGG, ARRAY_AGG, PERCENTILE_*), and sees groups smaller than the policy's
minimum folded into one remainder group.
What an AGGREGATION POLICY allows: which aggregates leak a row, and what a body's verdict says.
Handles
ALTER <object-type> … statements for DATABASE / SCHEMA / MASKING & ROW ACCESS
POLICY / TABLE / VIEW / STREAM / TASK / PIPE / WAREHOUSE / STAGE / USER / ROLE / SESSION / TAG,
extracted verbatim from SQLCommandVisitor.visitAlterStatement(dev.frostlake.parser.FrostlakeParser.AlterStatementContext).A bare column name carried by both sides of an ON-joined relation — live's "SQL compilation
error: ambiguous column name 'T'".
The one-row result an anonymous block answers when it runs as a statement — directly, or as the text
of an EXECUTE IMMEDIATE: a single column named
anonymous block holding the value its RETURN
produced, or NULL typed VARCHAR when the block ran to its end without a RETURN.Parses an expression string into an
Expression AST using the ANTLR grammar and
ExpressionAstBuilder.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.
Accumulator for
AnyValue.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).An accumulator whose result depends on whether its argument is APPROXIMATE, which the values alone
cannot always say.
The APPROXIMATE family's runtime carrier is a Java double, and these are the rules that follow from it.
APPROX_PERCENTILE(expr, percentile) — the approximate value at the given percentile (a constant in
[0, 1]) of
expr.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.Accumulator for APPROX_PERCENTILE(expr, percentile).
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.
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).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).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.The accumulator of
ApproxTopK: a TopKSummary sized by the call's third argument,
answering the first k of its ranking.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).The accumulator of
ApproxTopKCombine: every input state is read into one unbounded
TopKSummary, which is trimmed to the result's counter limit only once all of them are in.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).
The accumulator of
ApproxTopKAccumulate: a TopKSummary sized by the call's second
argument, serialised whole.Represents array element access (e.g., arr[0], data[index])
Accumulator for
ARRAY_AGG(expr).ARRAY_APPEND(array, value) — appends value to array and returns the new array.
ARRAY_CAT(array1, array2) — concatenates two arrays.
ARRAY_COMPACT(array) — returns the array with all null elements removed.
ARRAY_CONSTRUCT(val1, val2, ...) — builds a JSON array from the given values.
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).
ARRAY_CONTAINS(value, array) — returns TRUE if the array contains the value.
ARRAY_DISTINCT(array) — removes duplicate elements.
ARRAY_EXCEPT(array1, array2) — the MULTISET difference: max(0, N-M) copies of each element.
ARRAY_FLATTEN(array) — flattens one level of nested arrays.
Shared helpers for array/object scalar functions.
ARRAY_GENERATE_RANGE(start, stop [, step]) — an array of integers from start (inclusive) to stop
(EXCLUSIVE). step defaults to 1 and may be negative.
ARRAY_INSERT(array, pos, element) — inserts element at 0-based index pos, shifting later elements right.
ARRAY_INTERSECTION(array1, array2) — the MULTISET intersection: min(N, M) copies of each element.
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.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.
ARRAY_POSITION(value, array) — 0-based index of the first element equal to value, or NULL.
ARRAY_PREPEND(array, value) — prepends value to the front of the array.
ARRAY_REMOVE(array, value) — removes all occurrences of value from array.
ARRAY_REMOVE_AT(array, index) — removes element at given index (0-based).
ARRAY_REPEAT(value, n) — an array of n copies of the value.
ARRAY_REVERSE(array) — returns the array with its elements in reverse order.
ARRAY_SIZE(array) — returns the number of elements.
ARRAY_SLICE(array, from, to) — returns a sub-array from index `from` (inclusive) to `to` (exclusive).
ARRAY_SORT(array [, sort_ascending [, nulls_first]]) — sorts elements. sort_ascending defaults to TRUE.
ARRAYS_OVERLAP(array1, array2) — returns TRUE if the arrays share at least one element.
ARRAYS_TO_OBJECT(keys, values) — an object pairing the key array with the value array by index.
ARRAYS_ZIP(a1, a2, …) — an array of objects pairing same-index elements under keys $1, $2, ….
ARRAY_TO_STRING(array, delimiter) — joins array elements with a delimiter.
Snowpark's
Array type, carrying the element type.ARRAY_UNION_AGG(array) — an aggregate whose every input row is itself an ARRAY.
Accumulator for
ArrayUnionAgg — Snowflake's MULTISET union (live-verified): every element
appears with the MAXIMUM multiplicity it has in any single input array, so
[2,2,2] UNION [2,2] is [2,2,2] and [5,5] alone keeps both.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.
Accumulator for
ArrayUniqueAgg.AS_BINARY(v) — the value when it is BINARY, else NULL (the engine's variant model carries no binary members).
AS_DATE(v) — the value when it is a DATE, else NULL (variant members carry dates as text).
AS_DECIMAL(v [, precision [, scale]]) — the variant's numeric value as a fixed-point number
rounded (HALF_UP) to the given scale, else NULL.
Snowflake
ASOF JOIN: for every left row, the single CLOSEST right row that satisfies the
MATCH_CONDITION — the newest right row at or before the left row's timestamp, and the
mirror-image for the < / <= directions.AS_TIME(v) — the value when it is a TIME, else NULL.
AS_TIMESTAMP_NTZ(v) — the value when it is a TIMESTAMP, else NULL (LTZ/TZ alias here too).
Renders an
Expression AST into a compact, canonical S-expression string.ATANH(x) — inverse hyperbolic tangent, computed as
0.5 * ln((1 + x) / (1 - x)) since Math
has no atanh.Snowflake's AUTO date/time input detection: a lenient field scanner for the timestamp and date forms
Snowflake accepts without an explicit format model.
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).Accumulator for
Avg, delegating the numeric result to AggregateNumerics.avg(Iterable) so
every AVG code path shares the same live-verified Snowflake typing: fixed-point inputs (Long/Integer/
BigDecimal) yield a BigDecimal with scale = (max input scale) + 6 rounded HALF_UP and trailing zeros kept
(AVG of 90 and 95 is exactly 92.500000), while any Double/Float/VARIANT input keeps the double average.BASE64_DECODE_BINARY(string) — decodes a base64 string into a BINARY value.
BASE64_ENCODE(expr [, max_line_length [, alphabet]]) — the base64 encoding of the input's bytes.
The optional arguments the base64 family carries beyond its input.
Handles Snowflake Scripting
BEGIN … [EXCEPTION …] END blocks, extracted verbatim from
SQLCommandVisitor.visitBeginEndBlock(dev.frostlake.parser.FrostlakeParser.BeginEndBlockContext) together with its cohesive exception-handling helpers
(bindHandlerErrorVariables, shouldHandleException, matchesSnowflakeException —
each used only by this path).Represents a BETWEEN expression (e.g., x BETWEEN 1 AND 10)
BINARY_AS_STRING(bin) — the binary input's bytes interpreted as UTF-8 text.
A hex BINARY literal's text,
X'..', read the way live reads it: SPACES inside the quotes are
dropped wherever they fall (X'00 11' is two bytes, X'0 0' one), and what remains
must be pairs of hexadecimal digits.Represents a binary operation (e.g., a + b, x > 5, name = 'Alice')
The type an arithmetic or concatenation expression is statically KNOWN to produce.
The operator of a
BinaryOperationExpression — arithmetic, comparison, logical, and string operators.Snowpark's
Binary type.The BINARY family.
Runtime value of the SQL BINARY type: an immutable byte sequence.
How a BINARY's width is spelled where the plan names the type —
SYSTEM$TYPEOF and the
argument-type refusals (live-verified):A definition may not carry an unnamed bind.
A
:name bind-variable reference — inside a Snowflake Scripting block, SQL statements
refer to the block's variables (and a procedure's parameters) as :name.Substitutes procedural scripting BIND variables (
:var) into raw SQL text before it is
parsed/executed.Accumulator for
BitAndAgg.BITCOUNT(n) — the number of set bits in the integer value.
Accumulator for
BitOrAgg.The whole number a bitwise function reads an argument as.
Accumulator for
BitXorAgg.BOOLAND(expr1, expr2) — three-valued logical AND over numeric/boolean inputs
(non-zero is TRUE, zero is FALSE).
Accumulator for
BoolAndAgg.The three boolean aggregates' shared argument rule.
The two conditional-event window functions, and what their plan echo shows about their argument.
Snowpark's
Boolean type.Shared truthiness helper for the BOOLAND / BOOLOR / BOOLNOT / BOOLXOR functions.
BOOLNOT(expr1) — three-valued logical NOT over a numeric/boolean input
(non-zero is TRUE, zero is FALSE).
BOOLOR(expr1, expr2) — three-valued logical OR over numeric/boolean inputs
(non-zero is TRUE, zero is FALSE).
Accumulator for
BoolOrAgg.BOOLXOR(expr1, expr2) — three-valued logical exclusive-OR over numeric/boolean
inputs (non-zero is TRUE, zero is FALSE).
Accumulator for
BoolXorAgg.Exposes the build version, stamped in at package time by Maven resource filtering
(
frostlake-version.properties carries version=${project.version}).Snowpark's
Byte type.Represents a CASE expression
Represents a type cast (e.g., CAST(x AS INTEGER), x::VARCHAR).
The optional field modifier of
CAST(expr AS <structured type> [RENAME FIELDS | ADD FIELDS]).Serializable snapshot of catalog metadata
CEIL(n [, scale]) — the input rounded UP, to whole numbers by default and to
scale decimal
places when one is given.Change type enum - represents the type of DML operation
CHARINDEX(needle, haystack [, start]) — POSITION's argument order; BINARY pairs search by BYTE.
A CHECK constraint: a boolean expression every written row must not make FALSE.
Serializable snapshot of a CHECK constraint (its name, expression text and named columns).
CHECK_JSON(str) — returns NULL if valid JSON, otherwise an error description string.
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).Classloader for IMPORTS handler jars that prefers the jar (and its stage-sibling dependency jars)
over the engine's classpath — the equivalent of Snowflake running a UDF against the dependency set
its PACKAGES clause supplies, not against whatever the warehouse happens to have loaded.
A value as a CLIENT reads it — the text a driver hands back from
getString.Validates clustering-key expressions: every column reference must name a column of the table.
An accumulator whose numeric answer can be asked of a VARCHAR or VARIANT argument.
COLLATE(expr, 'spec'), also written expr COLLATE 'spec': the string itself, carrying
the named collation into whatever compares it.A sorting, grouping or DISTINCT key that carries the collation it compares under.
COLLATION(expr): the collation specification expr carries, lower-cased, or NULL when
it carries none.How strongly an expression holds its collation when two meet in one comparison — the three levels
live ranks them by, lowest first.
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.
A collation specification — the text COLLATE names in a column definition or an expression — parsed
into the rules a string comparison runs by.
A column expression, carried as the SQL it stands for.
Serializable column data
Parses column / data-type / constraint / default-value grammar into metastore models — extracted from
DDLCommandHandler (CREATE TABLE, CREATE FUNCTION/PROCEDURE parameters, DROP FUNCTION arg types,
ALTER) so those handlers share one parser.A value too long for its
VARCHAR(n) column, rejected on the write path.The length a client reads for a result column: a text column's length in characters and a binary
column's in bytes, which Snowflake's driver answers as the column's precision and display size.
Represents a column reference (e.g., "name", "users.id", "u.name")
Serializable snapshot of column metadata
Snowflake's compile-time type matching of a value against the column it is written to (live-verified
matrix).
SHOW COLUMNS'
data_type cell.Base interface for SQL command handlers
Handles
COMMENT ON <object-type> … statements, extracted verbatim from
SQLCommandVisitor.visitCommentStatement(dev.frostlake.parser.FrostlakeParser.CommentStatementContext).A running sum of doubles with Kahan compensation, which is the closest single rule to how the account
adds them.
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.The compression algorithms
COMPRESS / DECOMPRESS_STRING / DECOMPRESS_BINARY
accept.The four compression algorithms behind
COMPRESS / DECOMPRESS_STRING /
DECOMPRESS_BINARY.The
method argument of COMPRESS / DECOMPRESS_STRING /
DECOMPRESS_BINARY: an algorithm name with an optional compression level in parentheses,
e.g.An account-level compute pool.
A compute pool's lifecycle state as SHOW COMPUTE POOLS spells it.
Thread-safe wrapper around DatabaseEngine for concurrent multi-user access
Manages sessions and ensures proper isolation between concurrent requests
Which conditional branch a DDL statement took — the two outcomes whose status sentence depends on
what the catalog held BEFORE the statement ran, which the parse tree alone cannot say.
The conditional branch the CURRENT statement's DDL handler took, reported by the handler itself:
the status sentence for
CREATE … IF NOT EXISTS that found its object, and for
DROP … IF EXISTS that did not, depends on what the catalog held a moment BEFORE — a fact
only the handler's own skip branch knows.Snowflake hierarchical queries —
[START WITH <pred>] CONNECT BY [PRIOR] c = [PRIOR] c.CONNECT_BY_ROOT <column>: the column's value on the ROOT row of the hierarchy branch that
produced the current row.Interactive console client for Frostlake SQL Engine
Provides a REPL interface for executing SQL commands with command history support
An accumulator that reads its constant arguments from the call's TEXT rather than from the rows —
the APPROX_TOP_K family's item and counter limits, which must be known even when no row arrives:
an empty group still reports the capacity it was configured with.
Reads the constant integer an aggregate call wrote as one of its arguments — the k and the counter
limit of the APPROX_TOP_K family — from the argument's text.
Names for constraints declared without an explicit
CONSTRAINT <name> clause.Snowflake CONTACT — a schema-level object naming who to reach about an object, attached to tables
(and other objects) for a PURPOSE with
ALTER TABLE … SET CONTACT <purpose> = <contact>.Serializable snapshot of a CONTACT (its three properties and its owner).
The parent container a CREATE authorization check targets — the scope that must grant the CREATE
privilege.
A block's
WHEN … CONTINUE THEN exception handling, consulted by loop executors so that a
loop-body error matching a CONTINUE handler resumes at the next loop iteration (Snowflake CONTINUE
semantics).Executes the COPY subsystem — the stage-file load (
COPY INTO <table>) and unload
(COPY INTO <stage>) paths, VALIDATION_MODE, COPY transformations, and the file/format dispatch —
on behalf of QueryExecutor.The category / code / SQLSTATE triple a
VALIDATION_MODE = RETURN_ERRORS row carries for
one rejected record, live-verified per family: a value that would not convert is
conversion / 100038 / 22018; a record whose field count misses the table is
parsing / 22000 with code 100080 (short or long record) or 100068 (end of record reached
mid-column, the blank-line case); a FILES entry the stage does not hold is
other / 100112 / 22000.The FIRST record one staged file rejected, as
COPY INTO <table> reports it in the trailing four
columns of its per-file result — first_error, first_error_line,
first_error_character and first_error_column_name.Accumulator for
Corr.The correlated subqueries live can evaluate.
A Cortex search service: a named, indexed view over one text column of a query's result, queried
back through
SNOWFLAKE.CORTEX.SEARCH_PREVIEW.A Cortex search service as it survives a restart: the whole definition, since nothing about it is
derived from data the engine keeps elsewhere.
Accumulator for
Count.Accumulator for
CountIf.Handles CREATE for infrastructure objects — TASK, PIPE, SEQUENCE, WAREHOUSE, STAGE — extracted from
DDLCommandHandler, which keeps the CREATE dispatch and delegates here.Handles the namespace CREATE shapes — DATABASE and SCHEMA (including CLONE) — extracted from
DDLCommandHandler, which keeps the CREATE dispatch and delegates here.Handles the SELECT-backed CREATE shapes — VIEW, MATERIALIZED VIEW, and DYNAMIC TABLE — extracted from
DDLCommandHandler, which keeps the CREATE dispatch and delegates here.Handles CREATE FUNCTION and CREATE PROCEDURE (UDF / stored-procedure creation across SQL/JS/Python/Java/
Scala), extracted from
DDLCommandHandler, which keeps the CREATE dispatch and delegates here.Handles CREATE for security / governance objects — TAG, MASKING POLICY, ROW ACCESS POLICY, USER, ROLE —
extracted from
DDLCommandHandler, which keeps the CREATE dispatch and delegates here.Handles CREATE TABLE (plain, CLONE, and CREATE TABLE AS SELECT), extracted from
DDLCommandHandler, which keeps the CREATE dispatch and delegates here.A task's
USING CRON <minute> <hour> <day-of-month> <month> <day-of-week> <time zone>
schedule, parsed once and asked for its next fire time on the calendar.A staged CSV record whose field count does not match the target table's column count, rejected by
ERROR_ON_COLUMN_COUNT_MISMATCH (see
CopyCommandExecutor.requireCsvColumnCount for the rule and the live evidence behind it).CURRENT_ACCOUNT() function - returns the account identifier
The account ID can be configured in the frostlake.properties file with the key 'account.id'
CURRENT_ACCOUNT_NAME() — the account's NAME, configured through
account.name.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.
CURRENT_CLIENT() — the identifier of the client library the session is connecting through.
CURRENT_IP_ADDRESS() — the client IP address (loopback for the embedded engine).
CURRENT_ORGANIZATION_NAME() — the organization the account belongs to, configured through
organization.name.CURRENT_ROLE_TYPE() — the current role type (always an account-level ROLE here).
CURRENT_SCHEMAS() — the active search path as a JSON array of the current schema.
CURRENT_SECONDARY_ROLES() — the active secondary roles (none in the embedded engine).
CURRENT_STATEMENT() — the text of the statement being executed, from the session.
CURRENT_TRANSACTION() — the open transaction id (ids are not exposed; NULL, as Snowflake returns outside a transaction).
CURRENT_VERSION() — the version of the running engine, taken from
BuildInfo.version() so it tracks
the built artifact.Represents a cursor for iterating through query results in stored procedures
Owns the named-cursor registry for
ProceduralExecutor: declaration, lookup, and the
save/restore of cursor names around nested blocks.JDBC CallableStatement implementation for Frostlake SQL Engine
Supports stored procedure calls with IN and OUT parameters
JDBC Connection implementation for Frostlake SQL Engine
JDBC Driver for Frostlake SQL Engine
Usage:
Class.forName("dev.frostlake.jdbc.DatabaseDriver");
Connection conn = DriverManager.getConnection("jdbc:frostlake://localhost:8080", props);
Main Database SQL Engine
Provides a complete SQL engine implementing Snowflake DB features
HTTP server for Frostlake SQL Engine
Provides REST API for SQL execution with concurrent multi-user support
Simplified JDBC DatabaseMetaData implementation for Frostlake SQL Engine
Only implements the most commonly used methods
JDBC PreparedStatement implementation for Frostlake SQL Engine
JDBC ResultSet implementation for Frostlake SQL Engine
JDBC ResultSetMetaData implementation for Frostlake SQL Engine
Serializable snapshot of database metadata
JDBC Statement implementation for Frostlake SQL Engine
A Snowpark DataFrame: a PLAN, not a result.
One DATA METRIC FUNCTION attached to a table, over the columns it measures — or over none, for the
table-level metrics (ROW_COUNT, FRESHNESS and their kind).
The system DATA METRIC FUNCTIONS, which all live in SNOWFLAKE.CORE — read off a live account, so
an attachment naming something else is refused the way live refuses it.
INFORMATION_SCHEMA.DATA_METRIC_FUNCTION_REFERENCES — the DATA METRIC FUNCTIONS attached to
an object, or the objects one metric is attached to.Base of the Snowpark type hierarchy, as inline Java handlers see it.
The one
dataTypeName parse-tree → DataType mapping, shared by column / parameter
definitions (ColumnDefinitionParser) and by expression casts (the expression AST builder), so
a type spelled in a CREATE TABLE and the same type spelled in a CAST produce the same object.The type instances a handler names, e.g.
DATE(<expr>) — the alias of TO_DATE that ALSO accepts an epoch NUMBER.Snowpark's
Date type.Small shared helper for the date/time functions.
DAYOFWEEKISO(t) — ISO day of week, 1 (Monday) to 7 (Sunday).
Handler for DDL (Data Definition Language) commands:
CREATE, DROP, ALTER, USE, TRUNCATE, COMMENT
The sentence a statement that produces no rows of its own answers with.
A whole number read from a scaled NUMBER —
3.00 out of a NUMBER(10,2) — which keeps the DECIMAL
kind inside a VARIANT.Snowpark's
Decimal(precision, scale) type.The type an UNTYPED declaration (
LET y := <expr>, DECLARE y DEFAULT <expr>) takes from
an initialiser the direct rules do not cover: the initialiser is typed as a SQL expression over the
declared types in scope, then widened the way live declares the name.An accumulator that needs the aggregated expression's DECLARED type, which its values cannot give
— a NUMBER(10,2) column and a literal 1.5 both arrive as a BigDecimal, and only the declaration says
which width the APPROX_TOP_K_ACCUMULATE state must report.
The declared RETURNS type of the procedure whose body is running, with the block and compound
depths its body started at — what tells a RETURN written directly in that body (the one live
converts to the declared type) from one nested in an IF, a loop, a handler or an inner block (kept
as it is).
The type a set of BRANCHES agree on — the rule a UNION applies to its arms and a conditional applies
to its results.
Statement for declaring user-defined exceptions
DECODE(expr, search1, result1 [, search2, result2 ...] [, default])
Like a searched CASE: compares expr to each search value and returns the matching result.
Decoded bytes read back as TEXT, which they are only allowed to be when they are valid UTF-8.
DECOMPRESS_BINARY(input, method) — decompresses a BINARY input and returns the decompressed
bytes as BINARY, matching Snowflake's signature.
DECOMPRESS_STRING(input, method) — decompresses a BINARY input and returns the bytes as UTF-8
text.
DECRYPT_RAW(value, key, iv [, additional_authenticated_data [, encryption_method [, aead_tag]]]) —
reverses
EncryptRaw.The bare word
DEFAULT where a DML value is expected — INSERT … VALUES (DEFAULT),
UPDATE t SET c = DEFAULT, and the same two inside MERGE.A column
DEFAULT whose value is a non-literal expression (arithmetic, string
concatenation, a function call, CASE, …) rather than a stored constant.Statement-scoped duplicate-key guard for deferred-apply INSERTs.
JDBC Array implementation for Frostlake SQL Engine.
Simple CallableStatement implementation for DirectConnection
Extends DirectPreparedStatement and adds OUT parameter support
Direct JDBC connection that wraps a DatabaseEngine instance without HTTP.
JDBC DatabaseMetaData implementation for DirectConnection.
Simple PreparedStatement implementation for DirectConnection
Simple ResultSet adapter for engine ResultSet with updatable support
Direct Statement implementation for embedded DatabaseEngine
JDBC Struct implementation for Frostlake SQL Engine.
TableDataStore over a checkpoint's tables directory — one serialized file per table.DIV0(a, b) divides like the
/ operator but returns 0 when the divisor is 0.Handler for DML (Data Manipulation Language) commands:
INSERT, UPDATE, DELETE, MERGE
Demonstration of INSERT, UPDATE, and DELETE operations
The envelope live wraps a DML write failure in —
DML operation to table T failed on column C
with error: … — around whatever sentence the value itself earned.Snowpark's
Double type.Handles DROP statements (DROP TABLE/VIEW/DATABASE/SCHEMA/STREAM/TASK/SEQUENCE/...), extracted from
DDLCommandHandler, which keeps the public dispatch and delegates here.A snapshot of a dropped object retained for UNDROP (Time Travel restore): the metadata object
(
Table / Schema / Database) plus the row data captured at drop time — a single
row list for a dropped table, or DroppedObject.getTableRows() keyed by fully-qualified table name for a dropped
schema or database (which may contain many tables).Represents a Snowflake DYNAMIC TABLE — a table whose contents are automatically
refreshed from a query, with a configurable target lag.
The properties ALTER DYNAMIC TABLE sets or unsets.
Serializable snapshot of a DYNAMIC TABLE definition.
The shapes a name with an empty middle part,
db..t, cannot take where it is written — live's
syntax errors, judged once the statement has parsed.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.
ENCRYPT_RAW(value, key, iv [, additional_authenticated_data [, encryption_method]]) — raw-key AES-GCM
authenticated encryption.
Where a statement's input ENDS, which is the anchor live gives every refusal that ran out of text —
the position one PAST the last character, not the last character itself.
Configuration manager for Frostlake SQL Engine
Loads configuration from frostlake.properties file
Demonstration of WHERE, GROUP BY, and ORDER BY operators
EQUAL_NULL(a, b) — NULL-safe equality: returns TRUE if both NULL, TRUE if equal, FALSE otherwise.
The ONE carrier an exact NUMBER(p, s) column holds, whatever path a value arrives by.
A stored procedure's caller-rights mode:
ExecuteAs.OWNER (the default — runs with the owner's privileges) or
ExecuteAs.CALLER (runs with the caller's privileges).EXECUTE IMMEDIATE <sql-expr> [USING (v1, v2, …)] used as an expression: the SQL string (itself an
expression — a literal, bind variable, concatenation, …) is evaluated, any USING values are bound to its
? placeholders, the dynamic statement is executed, and its first column of the first row is
returned (scalar), like a scalar subquery.Execution result container
Base interface for all expression nodes in the AST
Pure arithmetic, temporal and comparison helpers extracted from
ExpressionEvaluatorVisitor:
numeric/date add/subtract/multiply/divide/negate, three-valued truthiness, value equality/ordering and
INTERVAL application.Builds
Expression AST nodes directly from the ANTLR parse tree.The collation an expression carries into a comparison, with the level it holds it at — see
CollationLevel.Whether a projection expression NAMES a given column — read from the expression's own tokens, the
way
MaskingPolicyApplier rewrites references, so a name inside a string literal and a
same-named function call are both left out of it.Evaluates expressions against rows.
Evaluates expression AST using the visitor pattern
Where the expression currently being evaluated started inside its statement — the missing half of a
reported position.
Visitor interface for expression AST traversal
The two lookup tables behind the FILE family, both measured against a live Snowflake account on
rather than inferred from the function names.
Builds and validates the file-metadata object that IS a FILE value.
A named file format object (CREATE FILE FORMAT) — a reusable set of parsing/formatting options (TYPE plus
format-specific options like FIELD_DELIMITER, SKIP_HEADER) that COPY statements reference via FORMAT_NAME.
A FILE_FORMAT that names a file format.
Serializable snapshot of a named FILE FORMAT — its TYPE plus the format-specific options map
(insertion order preserved).
The per-TYPE file-format property surface a real account exposes, measured tree by tree: which
options each type accepts (an option outside its type's tree refuses
Option X is not
valid for file format type Y.), each property's declared type, its current-value default and
the constant default column DESC prints (JSON-family NULL_IF starts [] while the
default column still reads [\N]).Shared argument handling for the fourteen
FL_* accessors, mirroring the family-local helper
pattern of VectorFunctionHelper.The FILE column type: a reference to a file on a stage.
Yields only the rows from its source that satisfy a predicate (the streaming WHERE).
FLATTEN — expands semi-structured data into one row per element.
FL_GET_CONTENT_TYPE(file) — the file's MIME content type.FL_GET_ETAG(file) — the staged file's entity tag.FL_GET_FILE_TYPE(file) — the file's single category name: image, video,
audio, document, compressed or unknown.FL_GET_LAST_MODIFIED(file) — when the staged file was last modified.FL_GET_RELATIVE_PATH(file) — the file's path within its stage.FL_GET_SCOPED_FILE_URL(file) — the descriptor's SCOPED_FILE_URL field.FL_GET_SIZE(file) — the file's size in bytes.FL_GET_STAGE(file) — the stage the file lives on.FL_GET_STAGE_FILE_URL(file) — the descriptor's STAGE_FILE_URL field.FL_IS_AUDIO(file) — whether the file's CONTENT_TYPE is one of the audio types.FL_IS_COMPRESSED(file) — whether the file's CONTENT_TYPE is one of the archive types.FL_IS_DOCUMENT(file) — whether the file's CONTENT_TYPE is one of the document types.FL_IS_IMAGE(file) — whether the file's CONTENT_TYPE is one of the image types.FL_IS_VIDEO(file) — whether the file's CONTENT_TYPE is one of the video types.A JSON double node that remembers it came from a SQL FLOAT — TO_VARIANT of a FLOAT column, a
computed double, a
::FLOAT cast — rather than from JSON text.Snowpark's
Float type.FLOOR(n [, scale]) — the input rounded DOWN, to whole numbers by default and to
scale
decimal places when one is given.A value PRESENTED at the type a conditional fold declares — the conversion the account plans as a
CAST on every branch, so the branch handed back reads at the fold whatever it was written as:
Represents a FOREIGN KEY constraint (final not enforced, final metadata only)
Serializable form of a table-level
ForeignKeyConstraint for catalog snapshots.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.
One property row: name, declared type, current-value default, DESC's default column.
This class provides an empty implementation of
FrostlakeListener,
which can be extended to create a listener which only needs to handle a subset
of the available methods.This class provides an empty implementation of
FrostlakeVisitor,
which can be extended to create a visitor which only needs to handle a subset
of the available methods.This interface defines a complete listener for a parse tree produced by
FrostlakeParser.This interface defines a complete generic visitor for a parse tree produced
by
FrostlakeParser.Represents a function call (e.g., UPPER(name), COUNT(*), SUM(salary))
ServiceLoader SPI for optional function packs.
The static column factories a handler imports as
import static
com.snowflake.snowpark_java.Functions.*;.Serializable snapshot of a user-defined FUNCTION (any language, scalar or table).
GENERATOR table function - generates rows with sequential numbers
Supports:
- ROWCOUNT => n (generates n rows)
- TIMELIMIT => seconds (generates rows for specified time period)
Snowpark's
Geography type.The GEOGRAPHY column type: spherical (lon/lat, SRID 4326) geospatial values carried as
GeoValue.Snowpark's
Geometry type.The GEOMETRY column type: planar (cartesian, default SRID 0) geospatial values carried as
GeoValue.The GEOSPATIAL type predicate shared by the strict-argument rules:
GeographyType and
GeometryType are ONE family for every rejection measured on the account.Runtime value of the GEOGRAPHY / GEOMETRY types: the GeoJSON model (
{"coordinates": …,
"type": "Point"} with sorted keys, Snowflake's default output form) plus the KIND — geography
(spherical, SRID 4326) or geometry (planar, SRID configurable, default 0).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.GETDATE() - the statement's instant in the session's zone, as TIMESTAMP_LTZ.
GET_DDL('<object_type>', '<object_name>' [, <use_fully_qualified_names>]) — reconstructs a
CREATE OR REPLACE statement for an object from the catalog.GET_IGNORE_CASE(obj, key) — like GET but matches object keys case-insensitively.
GET(object_or_array, field_or_index) — extracts a value by key (object) or index (array).
Handles
GRANT … and REVOKE … statements, extracted verbatim from
SQLCommandVisitor.visitGrantStatement(dev.frostlake.parser.FrostlakeParser.GrantStatementContext) and SQLCommandVisitor.visitRevokeStatement(dev.frostlake.parser.FrostlakeParser.RevokeStatementContext).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).
GROUP BY operator - groups rows and computes aggregates.
The value of an expression written over GROUPED rows, computed over the row's own source group.
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.
Resolves the sort value of an ORDER BY item that could NOT be matched to a SELECT column after GROUP BY /
aggregation — Snowflake allows ordering by a grouped column or an aggregate that is not in the SELECT list
(e.g.
HASH_AGG(expr) — a single, order-INDEPENDENT signed 64-bit hash over the whole (multi)set of input rows.
Accumulator for
HashAgg.The bytes HASH and HASH_AGG hash for one argument: a TYPE-CLASS tag followed by a canonical rendering
of the value.
HASH(expr[, …]) — a deterministic signed 64-bit hash (FNV-1a) over the canonical, type-tagged encoding
of its arguments.
Custom evaluator interface for HAVING conditions.
HAVING clause operator - filters rows after GROUP BY based on aggregate conditions.
HEX_DECODE_BINARY(string) — decodes a hex string into a BINARY value.
HEX_ENCODE(expr [, case]) — the hex encoding of the input's bytes, uppercase by default.
The higher-order functions — the ones whose last argument is a lambda, so the argument must NOT be
pre-evaluated.
HyperLogLog sketch for APPROX_COUNT_DISTINCT (Flajolet et al.), with linear counting in the
small-cardinality range.
ILIKE(subject, pattern) — the function-call form of the
subject ILIKE pattern operator
(case-INsensitive SQL wildcard match).How a TEXT reads as a number in exact arithmetic —
t + 0, t * n, MOD(t, 2),
ROUND(t, 1) — live-verified over VARCHAR columns of every declared length and over
literals:
a text COLUMN or expression reads as NUMBER(18,5): t + 0 declares
NUMBER(19,5) and answers 5.00000, t / 1 NUMBER(24,11), t % 2
NUMBER(18,5); the value is rounded HALF_UP to five decimals before the operation
('1.123456' + 0 is 1.12346);
a text LITERAL reads as NUMBER(18, s) with ITS OWN scale: '5' + 1 declares
NUMBER(19,0) and answers 6, '2.5' + 1 NUMBER(19,1) and 3.5, MOD('5', 2)
NUMBER(2,0);
text beside text, beside a FLOAT, beside a VARIANT or beside a bare NULL is a FLOAT, as is a
VARIANT beside anything and a signed text — those are not this reading.
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.Represents an IN expression (e.g., x IN (1, 2, 3) or x IN (SELECT ...))
Whether a dynamic table populates when it is created or waits for its first scheduled refresh.
In-memory class loader
In-memory Java file object
In-memory file manager
INSERT(base, position, length, insertion).
The compute-pool instance-family catalog, exactly as a real account lists it — the same rows
SHOW COMPUTE POOL INSTANCE FAMILIES answers with, in the same (non-alphabetical) order, and the
set CREATE COMPUTE POOL validates INSTANCE_FAMILY against.
How wide a WRITTEN integer literal may be.
The declared PRECISION of the integer-returning functions, which is not one number.
Snowpark's
Integer type.Represents an INTERVAL expression (e.g., INTERVAL '10' DAY)
The unit of an
IntervalExpression.A dotted column qualifier naming no FROM-clause key — live's "SQL compilation error: invalid
identifier 'R.C'": an alias REPLACES the table name, in the SELECT list, WHERE, GROUP BY and
ORDER BY alike (each measured).
INVOKER_ROLE() — the invoking role (the current role in the embedded engine).
IS_BINARY(v) — TRUE when the value is BINARY (never true for variant members in this engine's model).
IS_DATE(v) — TRUE when the value is a DATE (variant members carry dates as text, so those are FALSE).
IS_DECIMAL(v) — TRUE when the variant holds a fixed-point number (integral or decimal node).
IS_DOUBLE(v) — TRUE when the variant holds any number (Snowflake: DOUBLE, INTEGER or DECIMAL).
Represents an
x IS NULL / x IS NOT NULL test.IS_ROLE_IN_SESSION(name) — TRUE when the named role is the session's current role.
IS_TIME(v) — TRUE when the value is a TIME.
IS_TIMESTAMP_NTZ(v) — TRUE when the value is a TIMESTAMP (LTZ/TZ alias here; the engine models all as NTZ).
IS_VECTOR(x) — TRUE when the value is a VECTOR, FALSE for every other value VARIANT can hold.Loads a pre-compiled handler class from the JAR(s) named in a UDF/procedure's
IMPORTS clause — the
alternative to an inline AS $$ … $$ body.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.
Compiles and executes inline Java user-defined functions
Executes inline Java stored procedures by compiling them at runtime.
Live-verified array-bind typing rules for PreparedStatement batches: every batched row must
bind the same driver-side type per column (
setNull carries no type and matches
anything), and a mismatching row is refused at addBatch time with the driver's own
wording, SQLSTATE 0A000 and vendor code 200023.JDBC-based interactive console client for Frostlake SQL Engine
Connects via JDBC to HTTP server instead of using direct API
Shared marshaling between the engine's stored values / type names and JDBC types, used by both the
HTTP-backed (
Database*) and in-process (Direct*) ResultSet and metadata implementations so
the conversion lives in ONE place.Minimal
ParameterMetaData for the engine's PreparedStatements: reports the placeholder count.Interface for evaluating join conditions on pairs of rows.
JOIN_CONSTRAINT(JOIN_REQUIRED => <boolean>) — what a JOIN POLICY's body returns.The relations a join's merged relation is assembled from, and which of them an outer join extends
with NULLs: what the account's planner knows of a joined column's nullability beside its table's
statistics.
JOIN operator - joins two sets of rows based on a condition.
Snowflake JOIN POLICY — attached to a TABLE, it refuses to let that table be read on its own: the
query must INNER join it to a DIFFERENT table on an equality between their columns.
What a JOIN POLICY demands of a query's FROM clause: the protected table must be INNER joined to a
DIFFERENT table on an equality between their columns.
Type of join operation
Represents a JSON array literal (e.g., [1, 2, 3])
Array HOLES — the elisions a JSON array may be written with, which Snowflake reads as
undefined
elements instead of refusing the document.JSON_EXTRACT_PATH_TEXT(json, path) — parses the JSON text and returns the path's value as unquoted
text.
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.
Represents a JSON object literal (e.g., {'name': 'Alice', 'age': 30})
JSON staged-file reader: a top-level array yields one record per element, otherwise the file is read as
newline-delimited JSON (one record per non-blank line).
Shared utilities for JSON variant type-checking functions.
The collation a sorting, grouping or de-duplicating key compares under.
Accumulator for
Kurtosis.A lambda argument to a higher-order function —
<param> -> <body> or
(<param>, …) -> <body> (e.g.LAST_QUERY_ID() function - returns the query ID of the last executed query
LAST_TRANSACTION() — the last transaction id (ids are not exposed; NULL).
Demonstration of LATERAL JOIN functionality in Frostlake SQL Engine
LATERAL allows subqueries to reference columns from the outer query,
enabling correlated subqueries in the FROM clause.
A statement that BEGINS with comments reports its positions from the first real token, not from the
top of the text.
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).
LEFT(expr, n) — the leading n characters of a VARCHAR, or the leading n BYTES of a BINARY.
A VARCHAR the plan carries with no length of its own — the KEY and PATH columns of FLATTEN and the
VALUE column of SPLIT_TO_TABLE — which SYSTEM$TYPEOF spells as the bare word
VARCHAR while a
table built over it declares the full-width VARCHAR(16777216) (live-verified).LIKE(subject, pattern) — the function-call form of the
subject LIKE pattern operator (case-sensitive
SQL wildcard match, % = any run, _ = one char).Snowflake multi-pattern matching:
x LIKE ANY (p1, p2, …), x LIKE ALL (…) and
x ILIKE ANY (…), with an optional shared ESCAPE.Pure SQL LIKE/ILIKE evaluation extracted from
ExpressionEvaluatorVisitor: translate a LIKE
pattern (with an explicit ESCAPE char) to a regex and match against it, caching the compiled Pattern.LIMIT operator - restricts the number of rows returned.
Skips
offset rows then yields at most limit rows, returning null — and not
pulling any further from its source — once the limit is reached.LISTAGG(<expr> [, <delimiter>]) — concatenate values into a single string.
Accumulator for LISTAGG: concatenates the non-null accumulated values with
ListAggAccumulator.delimiter.Leaf source that streams rows from an existing list lazily (by index, without copying it).
Represents a literal value (string, number, boolean, null)
The kind of a
LiteralExpression value.Snowpark's
Long type.LPAD(expr, len [, pad]) — a VARCHAR padded to len characters, or a BINARY padded to len BYTES.
Example usage of the Frostlake SQL Engine
MAP_CAT(map1, map2) — the concatenation (merge) of two MAPs.
MAP_CONSTRUCT(key, value [, key, value …]) — a MAP built from alternating key/value arguments.
MAP_CONTAINS_KEY(key, map) — whether the map holds the key.
MAP_DELETE(map, key [, key …]) — the map without the named keys.
MAP_ENTRIES(map) — the map's entries as an array of
{"key": …, "value": …} objects, in key
order.Types and shared reads for the MAP built-in family (MAP_KEYS, MAP_SIZE, MAP_CAT and the rest).
MAP_INSERT(map, key, value [, updateFlag]) — the map with one entry added or replaced.
MAP_KEYS(map) — the map's keys as an array, in key order.
MAP_PICK(map, key [, key …]) and MAP_PICK(map, keyArray) — the map narrowed to the named keys.
MAP_SIZE(map) — the number of entries.
Snowpark's
Map type, carrying the key and value types.The structured
MAP(keyType, valueType) type.Snowflake MASKING POLICY — transforms a column value based on the querying user's role.
The type rule a masking policy attachment must pass.
Serializable snapshot of a single MASKING POLICY parameter (name + data-type name + optional default).
Serializable snapshot of a MASKING POLICY definition.
Accumulator for
Max.MAX_BY(value, sort_key) — a two-argument aggregate returning the
value from the row whose
sort_key is the maximum.MD5(msg) — the lowercase hex MD5 digest of the message bytes.
MD5_BINARY(msg) — the 16-byte MD5 digest as BINARY.
Accumulator for
Median, delegating to AggregateNumerics.median(Iterable) so the
interpolating percentiles share one typing rule.TableDataStore held entirely in memory — the transport for in-JVM engine cloning.Demonstration of MERGE (UPSERT) operations
The MERGE evaluation shape for one (source table, target table, aliases) combination: the merged
__MERGE__ table exposing alias.col / tablename.col / bare-name slots, one
ExpressionEvaluator over it, and the slot mapping that refills a values list per
source/target row pair.Accumulator for
Min.MIN_BY(value, sort_key) — a two-argument aggregate returning the
value from the row whose
sort_key is the minimum.MODE's accumulator: the most frequent non-NULL value, a tie going to the value seen FIRST.
How an accumulator that needs more than one argument per row receives them.
A scalar subquery whose select list has more than one item — refused while the statement compiles
("Unsupported: Scalar subquery with multi-column SELECT clause.", anchored on the subquery's own
SELECT), a refusal that has to escape the typing pass that finds it while every other planning
fault there merely leaves the subquery untyped.
What a request carrying SEVERAL statements answers when one of them fails while running.
NEGATE(n) — the negative of the numeric input.
NEXTVAL function - gets the next value from a sequence
Usage: NEXTVAL('sequence_name') or sequence_name.NEXTVAL
NO_AGGREGATION_CONSTRAINT() — the AGGREGATION POLICY body that imposes nothing.Live's refusal of a statement that needs a current database the session does not have, naming what the
statement was doing, with no compilation-error prefix:
NaN and the infinities as SQL sees them — how their words are spelled, and how they compare.
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).NOW() / LOCALTIMESTAMP() — aliases of CURRENT_TIMESTAMP.
A UDF's NULL-handling behavior:
NullHandling.CALLED_ON_NULL_INPUT (the default — the body runs even for NULL
arguments) or NullHandling.RETURNS_NULL_ON_NULL_INPUT (short-circuits to NULL; STRICT is its synonym).One value on its way INTO a numeric aggregate, converted the way live converts it — which for text
that is not a number means a refusal, not a zero.
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).A value that could not be read as a number where one was required — live's
"Numeric value 'a' is not recognized", and the VARIANT spelling of the same failure.
One element of a numeric input format model, as
NumericFormatModel scans it.A numeric INPUT format model — the format argument of TO_NUMBER / TO_DECIMAL / TO_NUMERIC, TO_DOUBLE and
TO_DECFLOAT over a text, and of their TRY_ twins — scanned into its alternatives and checked the way the
account checks it, before the text is read.
The NUMBER(precision, scale) Snowflake gives a numeric LITERAL.
The sentence a number too wide for its destination gets.
NVL2(expr1, expr2, expr3) — returns expr2 when expr1 is NOT NULL, otherwise expr3.
Represents object property access (e.g., data:name, json:address:city).
OBJECT_AGG(key, value) — aggregates key/value pairs into a single OBJECT.
Accumulator for
OBJECT_AGG(key, value) — collects key/value pairs into one OBJECT.OBJECT_CONSTRUCT(k1, v1, k2, v2, ...) — builds an object from key-value pairs.
OBJECT_DELETE(object, key1 [, key2, ...]) — removes one or more keys from an object.
OBJECT_INSERT(object, key, value [, update_flag]) — inserts/updates a key in an object.
OBJECT_KEYS(object) — returns an array of the object's keys.
OBJECT_PICK(object, key1 [, key2, ...]) — returns an object with only the specified keys.
Base interface for query execution operators.
Context object passed through the operator pipeline.
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 in SHOW BUILTIN FUNCTIONS (the 30 non-word names it
returns are != % * + - / : < <= <> = > >= COUNT(*) COUNT_INTERNAL(*) [] ||, the four
INTERVAL … arithmetic entries, IS NULL, IS NOT NULL,
OBJECT_CONSTRUCT(*), OBJECT_CONSTRUCT_KEEP_NULL(*) and
OBJECT_CONSTRUCT_KEEP_NULL_STRUCTURED(*), alongside word-shaped operator names such as
AND, OR, NOT, BETWEEN, IN, LIKE_ANY and DIV).Pipeline of operators for query execution.
How
GREATEST and LEAST order arguments that are not already the same family.Serializable snapshot of a routine/policy parameter: name, data-type name, optional default.
PARSE_IP(ip_address, type [, permissive]) — parses an IPv4/IPv6 address (optionally in CIDR
addr/prefix form) into a VARIANT OBJECT, matching Snowflake.Stateless helpers that read text and names out of ANTLR parse-tree nodes.
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.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.The double a FLOAT SUM or AVG answers, built from PARTIALS: each partial is a run of terms added with
Kahan compensation and read back with its last compensation applied
(
CompensatedSum.correctedValue()), and the partials are added in turn to a running compensated sum
that is read without it (CompensatedSum.value()).Accumulator for
PercentileCont, delegating to
AggregateNumerics.percentileCont(Iterable, double) — the same rule MEDIAN uses, MEDIAN being
this function at one half.The percentile digest behind APPROX_PERCENTILE_ACCUMULATE, _COMBINE and _ESTIMATE: a list of
centroids (mean, weight) serialised as
{"state":[mean, weight, mean, weight, …],
"type":"tdigest","version":1}, means ascending, every number in the fifteen-decimal exponent form
a DOUBLE takes inside a VARIANT.The accumulator of
ApproxPercentileAccumulate: one centroid of weight 1 per non-NULL value.The accumulator of
ApproxPercentileCombine: every input state's centroids, gathered.Accumulator for
PercentileDisc, delegating to
AggregateNumerics.percentileDisc(Iterable, double).Manages persistence of catalog metadata and table data to disk
Represents a Snowflake PIPE for continuous data loading
Serializable snapshot of a PIPE (its COPY statement and ingest settings).
Marks the thread as evaluating a POLICY BODY, for the functions that live only there.
INFORMATION_SCHEMA.POLICY_REFERENCES — every policy attached to one object, or every
object one policy is attached to.POSITION(needle, haystack [, start]) — the 1-based position of needle, or 0 when absent.
A membership index over a subquery's first-column values, built once for an uncorrelated
value IN (subquery) so each outer row is an O(1) probe instead of an O(subqueryRows) linear
scan — turning the membership test from O(outer × sub) into O(outer + sub).Demonstration of PRIMARY KEY functionality in Frostlake SQL Engine
PRIOR <column> inside a CONNECT BY predicate: the column's value on the PARENT row of
the hierarchy step being considered, as opposed to the candidate child row every other reference reads.Privilege types in Snowflake
Based on: https://docs.snowflake.com/en/sql-reference/sql/grant-privilege
Serializable snapshot of privilege grant
Builds the procedural-statement hierarchy (ProceduralBlock / IfStatement / CaseStatement /
LoopStatement / WhileStatement / ForStatement / …) from the ANTLR parse tree.
Serializable snapshot of a stored PROCEDURE (any language).
PROJECTION_CONSTRAINT(ALLOW => <boolean>) — what a PROJECTION POLICY's body returns.Snowflake PROJECTION POLICY — attached to a COLUMN, it decides whether that column may appear in a
query's select list at all.
Serializable snapshot of a PROJECTION POLICY (its body, comment and owner).
WHICH select item was being evaluated when a row-time failure was raised.
PROJECT operator - projects (selects) specific columns from rows.
Applies a per-row transform (the streaming projection) to its source.
An object's qualified name as its ordered identifier parts (
db.schema.name).Custom evaluator interface for QUALIFY conditions.
QUALIFY clause operator - filters rows based on window function results.
Represents a quantified comparison expression (e.g., x > ANY (subquery))
Handler for Query commands:
SELECT statements
Query Executor - Executes SQL statements using ANTLR-based parsing
Represents a single query execution in the query history
The INFORMATION_SCHEMA.QUERY_HISTORY() TABLE FUNCTION — Snowflake exposes query history ONLY this
way (
SELECT … FROM TABLE(INFORMATION_SCHEMA.QUERY_HISTORY(RESULT_LIMIT => n)); the bare
object form is "does not exist", live-verified).Tracks query execution history for the entire Frostlake engine instance
Demonstration of WHERE, GROUP BY, and ORDER BY operators
Query results held by query ID so RESULT_SCAN can read them back, plus the per-session history of
query IDs that LAST_QUERY_ID walks.
Callback a table function uses to run a SQL query text against the engine — the seam that lets
ToQuery execute its argument without depending on the executor class itself.RANDOM([seed]) — a pseudo-random signed 64-bit integer (not a fraction in [0, 1)).
RANDSTR(length, generator) — a deterministic random alphanumeric string seeded by the generator.
Shared helpers for the raw-key
EncryptRaw / DecryptRaw AES-GCM functions: hex BINARY
conversion (the engine represents BINARY as an uppercase hex string) and the encryption-method guard.Which step of an exact arithmetic operation ran out of the 128-bit carrier — the two refusal shapes
that need to know an operand's NULLABILITY before their sentence is complete (see
RawRangeOverflow).An exact arithmetic step ran out of the 128-bit carrier, and the sentence still needs the refused
operand's NULLABILITY — which only the evaluator holding the expression tree can resolve.
A foreign-key referential action (
ON DELETE / ON UPDATE).How a dynamic table refreshes: AUTO lets the account choose, and the CONFIGURED mode is not
always the RESOLVED one — a definition AUTO cannot refresh incrementally resolves to FULL.
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).Shared accumulator for the REGR_* linear-regression family.
REGR_AVGX(y, x) — average of the independent variable x over non-null (y, x) pairs (y dependent, x independent).
REGR_AVGY(y, x) — average of the dependent variable y over non-null (y, x) pairs (y dependent, x independent).
REGR_COUNT(y, x) — count over non-null (y, x) pairs (y dependent, x independent).
REGR_INTERCEPT(y, x) — y-intercept of the least-squares regression line over non-null (y, x) pairs (y dependent, x independent).
Which member of the REGR_* linear-regression family a
RegrAccumulator computes from its sums.REGR_R2(y, x) — coefficient of determination (R squared) over non-null (y, x) pairs (y dependent, x independent).
REGR_SLOPE(y, x) — slope of the least-squares regression line over non-null (y, x) pairs (y dependent, x independent).
REGR_SXX(y, x) — sum of squares of x deviations over non-null (y, x) pairs (y dependent, x independent).
REGR_SXY(y, x) — sum of products of x and y deviations over non-null (y, x) pairs (y dependent, x independent).
REGR_SYY(y, x) — sum of squares of y deviations over non-null (y, x) pairs (y dependent, x independent).
REGR_VALX(y, x) — x when BOTH arguments are non-NULL, else NULL.
REGR_VALY(y, x) — y when BOTH arguments are non-NULL, else NULL.
The kinds that share one name space inside a schema.
A thread-local mode in which a relation is read for its SHAPE and never for its rows: every base
source resolves to zero rows and a FROM-less item that cannot be computed is left NULL, so the
columns come out typed by the static channel while nothing value-dependent runs.
The statistics a DERIVED relation — a subquery, a CTE, a view — still carries of the one catalog
table beneath it, so that a query over the relation is planned from them as a query over the table
would be.
REPEAT(s, n): the string
n times over, NULL when either argument is NULL.REPEAT … UNTIL <condition> END REPEAT — a post-test loop: the body runs at least once, then the
condition is checked; iteration continues while the condition is false and stops once it is true.
RESULT_SCAN table function - retrieves cached query results by query ID.
Serializable result set data
Interface for providing ResultSets.
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.
Represents a Snowflake-compatible role
Serializable snapshot of role metadata
ROUND(n [, scale [, mode]]) — the input rounded to
scale decimal places, zero by default.The words ROUND's optional third argument takes.
What an
IMPORTS = ('@stage/file.jar') clause has to be true of at CREATE time.Static return-type inference for scalar SQL routine bodies: the type the body expression is KNOWN
to produce over the routine's declared parameters, or null when undetermined.
One row handed back by
DataFrame.collect().Snowflake ROW ACCESS POLICY — a SQL boolean predicate that filters rows.
The checks a row access policy attachment must pass, shared by the ALTER form and the CREATE TABLE /
CREATE VIEW clauses — live makes the same ones wherever the attachment is written, with a single
measured difference: an unknown column is an
invalid identifier on the ALTER path and a
column 'X' does not exist at CREATE, so the caller reports that one.Serializable snapshot of a ROW ACCESS POLICY definition.
Interface for evaluating a parsed expression AST on a row.
Per-row transform (projection) for
ProjectRowStream.Which row, counting from 0, the operator is currently evaluating expressions for — what the
SEQ1 / SEQ2 / SEQ4 / SEQ8 family reads.Row filter predicate for
FilterRowStream.Pull-based (volcano-model) stream of rows: each
RowStream.next() call produces one row on demand
and returns null when exhausted, so a downstream operator (e.g.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.
Resolves Snowflake-style S3 URLs (
s3://bucket/key) to a local filesystem path, so files that
live in S3 in production — most usefully the JAR(s) named in a UDF/procedure IMPORTS clause —
can be served from local disk in the local/CI testing the engine targets.Scaling policy enum - represents the warehouse scaling behavior
Task schedule type enum - represents the type of schedule
Serializable snapshot of schema metadata
Owns procedural scripting variable state and nested-scope semantics for
ProceduralExecutor:
the variable map plus the scope stack used by BEGIN…END and control-flow blocks.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.
One configured SEARCH OPTIMIZATION expression — a METHOD over a column, as
DESCRIBE SEARCH OPTIMIZATION ON <table> reports it.Serializable snapshot of one configured SEARCH OPTIMIZATION expression, number included.
The kind of catalog object an authorization check targets — the "securable object" in Snowflake
terms.
Security manager for enforcing access control based on granted privileges
Stateless accessors over SELECT-item parse-tree nodes — star / qualified-star / braced-star / expression
item predicates, plus the alias, qualifier and value/full expression of an item.
HOW a built-in refuses a statically OBJECT- or ARRAY-typed argument.
SEQ1 / SEQ2 / SEQ4 / SEQ8 — the row's 0-based ordinal, wrapped to the function's integer width.
Represents a database SEQUENCE object
Serializable snapshot of a SEQUENCE — its definition plus the current value, so NEXTVAL continues
where it left off after a reload.
Stub implementation of Snowflake Snowpark Session for inline Java/Scala procedures.
Stub of Snowpark's
Session.builder() fluent builder.Per-session context tracking user state
Each HTTP session has its own database/schema context
Manages the current user session context including active user and role
Manages HTTP sessions for concurrent users
Handles session creation, retrieval, and cleanup
The session parameters SHOW PARAMETERS lists, with their defaults, descriptions and type words.
One row of
SessionParameterCatalog: the parts of a session parameter that do not change with
the session.The optional body of
POST /api/sessions: the database and schema the new session starts in,
each an identifier reference as it would be written in SQL — a bare name folds to upper case, a
double-quoted one keeps its case.Per-session state synchronization object
The flavour a BARE
TIMESTAMP means, which the session's TIMESTAMP_TYPE_MAPPING parameter
names.Represents a $varname session variable reference inside procedural code.
The zone the session's TIMEZONE parameter names, reachable from the value layer.
Stateless set-operation row math — UNION / INTERSECT / EXCEPT (ALL and distinct variants) and DISTINCT —
extracted from
QueryExecutor.SHA1(msg) — the lowercase hex SHA-1 digest of the message bytes.
SHA1_BINARY(msg) — the 20-byte SHA-1 digest as BINARY.
SHA2(msg [, bits]) — the lowercase hex SHA-2 digest (256 by default) of the message bytes.
SHA2_BINARY(msg [, bits]) — the SHA-2 digest (256 default; 224/384/512) as BINARY.
Snowpark's
Short type.Executes SHOW / DESCRIBE catalog-introspection commands.
Handler for SHOW and DESCRIBE commands:
SHOW DATABASES, SHOW SCHEMAS, SHOW TABLES, DESCRIBE TABLE, etc.
What the TERSE / STARTS WITH / LIMIT modifiers actually do to one SHOW listing.
Small stateless helpers shared by more than one SHOW/DESCRIBE sub-executor.
An expression with every SIBLING SELECT ALIAS it mentions replaced by that alias's defining
expression.
The
SBn tag Snowflake prints for a fixed-point number — the smallest SIGNED-INTEGER width, in
bytes, that holds the number's unscaled value.Accumulator for
Skew.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 leading S); MI moves
the sign to a trailing position (- or blank) with no leading sign slot; a $
floats between the sign and the digits; 0 placeholders zero-pad; trailing fractional
9 positions render insignificant zeros as spaces (0.5 with '99.99' is
" 0.5 "); a value wider than the integer template renders # across the template
width; FM strips all of that padding.The three GROUPING / SORTING key positions Snowflake names in its "cannot be used as ... keys"
rejection.
Where a node sits inside the expression TEXT it was parsed from — a line (1-based) and a character
offset within that line (0-based), the two numbers Snowflake reports as
error line 1 at position 7.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).SPLIT_TO_TABLE — splits a string into one row per part, as SEQ, INDEX and VALUE.
The spread operator
**<expr>: inside an array constructor or a function argument list the
inner ARRAY's elements are spliced in as individual elements/arguments; inside an object
constructor the inner OBJECT's pairs are merged in.How Snowflake lays out an access-control refusal:
"SQL access control error:", a
newline, then the detail — the same two-line layout SqlCompilationError documents for
compilation errors.Visitor that executes SQL commands by visiting the ANTLR parse tree.
How Snowflake lays out a compilation-error message.
SQL auto-completion for console client
Provides completion for SQL keywords, table names, column names, and functions
Canonical form of a SQL identifier, matching Snowflake's identifier resolution:
an unquoted identifier folds to UPPERCASE (
site → SITE, so it lands in
the catalog, INFORMATION_SCHEMA, SHOW output and result-set column labels the same way Snowflake
stores it);
a "double-quoted" identifier keeps its exact case (the surrounding quotes are stripped);
a $n positional parameter becomes COLUMNn.
Binds a named parameter into a SQL body by substituting each occurrence of the parameter's bare name
with a replacement string — for UDF / stored-procedure bodies and masking-policy bodies, where the
parameter is written as an ordinary identifier.
Abstract base class for SQL database objects
Provides common properties and behavior for objects like databases, schemas, tables, views, etc.
HTTP request object for SQL execution
HTTP response object for SQL execution
A procedural expression backed by the full query-side expression AST (
Expression).Splits a multi-statement SQL SCRIPT into its top-level statements for clients that execute and
report per statement (the HTTP server's init script, the console's script runner).
The single, canonical decode for a single-quoted SQL string literal — the one place that turns a
STRING_LITERAL token (or its already-stripped inner text) into the value it denotes.Exception thrown when SQL syntax errors are detected during parsing
Small predicates over lexed SQL tokens, shared by the lexer-driven substitution paths
(
BindVariableSubstitutor, MaskingPolicyApplier, JdbcMarshaling).The single truthiness rule for a value in predicate position — Snowflake's implicit boolean
coercion: a BOOLEAN as itself, a VARCHAR via TO_BOOLEAN's text forms (
'true', 't',
'yes', 'y', 'on', '1', case-insensitive), a number as
zero/non-zero, NULL and anything else as FALSE.How Snowflake SPELLS a type back: the canonical name with its parameters, never the alias a column
was declared with.
The count, the sum and the sum of squares of a FLOAT series — the moments the account's variance
family reads over FLOATs.
Represents a Snowflake STAGE - a named location for staging data files.
A stage reference resolved to a concrete file: where it lives on disk, plus the two descriptor
fields that identify it inside its stage.
Byte access to staged files with transparent gzip: a name ending
.gz reads through a
GZIPInputStream.Represents a file in a stage
Callback
TO_FILE uses to turn a stage reference such as @stage/dir/file.txt into the
file it names — the seam that lets the FILE functions read real stage metadata without depending on
the executor class itself.Reads a staged file of a record-based FILE_FORMAT (JSON, XML, Avro, Parquet, ORC) into a list of
JsonNode records.Resolves the stage references
TO_FILE is given, reusing the executor's own
QueryExecutor.resolveCopyBaseDir(String) — the one place that already knows how
@stage, @db.schema.stage, @~ and @%table map onto local directories.Selects the
StageFileReader for a record-based FILE_FORMAT TYPE.Demonstration of STAGE functionality - Local filesystem staging
Serializable snapshot of a stage definition.
Stage type enum - represents whether a stage is internal or external
A star written as a function ARGUMENT —
COUNT(*), HASH_AGG(t.*),
COUNT(* EXCLUDE (a)), COUNT(* ILIKE 'a%') — and what it stands for: the in-scope
columns it expands to, so that the call is then an ordinary multi-argument one (live-verified: a
qualified star expands to that relation's columns only, an EXCLUDE drops the named columns, an ILIKE
keeps the matching ones, and HASH_AGG(t.*) equals HASH_AGG(t.a, t.b, t.c)).One effective output column produced by expanding a
SELECT * after its EXCLUDE / RENAME / REPLACE /
ILIKE modifiers: the value expression to project, the output column name (RENAME changes it), the original
source column name (to tell whether it was renamed), and a best-effort output data type.The scheduling state of a dynamic table's refresh.
The one instant a statement calls "now".
How many top-level statements a request holds, counted the way the account counts them
(live-verified).
Letting a statement's failure out with the message it already has.
The coarse kind of a tracked statement, classified from its leading keyword (see
QueryHistory.determineQueryType).The SEMICOLON between two statements, which live REQUIRES and this grammar leaves optional.
Statement type enum - represents the type of procedural statement
Accumulator for
StdDev.Accumulator for
StdDevPop.Represents a Snowflake Stream - Change Data Capture (CDC) mechanism
Streams record DML changes (INSERT, UPDATE, DELETE) made to a table
Manages streams and tracks changes to tables
One logical row's accumulated (net) change while consolidating a stream window:
oldValues
is the row's image at the stream offset (null when the row was born inside the window) and
newValues its current image (null when the row no longer exists).What a consuming DML's stream read actually SAW, captured at read time so the commit can advance the
stream past exactly that — and nothing more.
Serializable snapshot of a single change record buffered in a STREAM (the CDC tuple: row values, the
change type, whether it came from an UPDATE, and the source row id).
Demonstration of STREAMS and TASKS - Change Data Capture and Scheduled Execution
Serializable snapshot of a STREAM — its definition plus the pending (unconsumed) change records, which
are restored at offset 0 so consuming after a reload yields the same rows.
Represents the type of source object for a Stream
Stream type enum - represents the type of changes tracked by a stream
STRING_AS_BINARY(s) — the string's UTF-8 bytes as BINARY.
How WIDE the string a function returns is declared to be.
Snowpark's
String type.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.One column of a
StructType: its name, its type, and whether it admits NULL.An ordered list of
StructFields — the shape of a DataFrame, and itself a DataType so
it can nest.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.A STRUCTURED array type —
ARRAY(INT) — as opposed to the plain semi-structured
ArrayType.One declared field of a structured
OBJECT(name type [NOT NULL], ...) type.A STRUCTURED object type —
OBJECT(x VARCHAR, y NUMBER) — as opposed to the plain
semi-structured ObjectType.Predicates and rendering shared by the STRUCTURED types (
StructuredObjectType,
StructuredArrayType, MapType).Represents a subquery expression (scalar subquery or EXISTS)
Represents a subquery expression used in EXISTS, IN, or scalar subquery contexts
Per-(outer-query) memo for subqueries that are evaluated once per outer row.
SUBSTRING(expr, start [, length]) — a slice of a VARCHAR by characters or of a BINARY by BYTES.
Accumulator for
Sum.Custom ANTLR error listener that collects syntax errors and throws them in live Snowflake's
wording (live-verified): every error renders on its own line under the one compilation-error
prefix — a parser error as
syntax error line L at position P unexpected 'TOK'. (token
text verbatim, '<EOF>' at end of input), a lexer error (an unterminated literal or
quoted identifier — the lexer consumed to end of input) as
parse error line L at position P near '<EOF>'. positioned at the END of the input.SYSDATE() — the statement's instant in UTC, as TIMESTAMP_NTZ.
How many arguments the SYSTEM$ functions take.
Evaluates
SYSTEM$FUNCNAME(...) built-in system functions invoked from expression context.The
SYSTEM$ built-ins the engine evaluates itself.What
SYSTEM$TYPEOF answers: a DECLARED type name and a physical storage tag, and the two come
from different places — which is the whole point of this class.SYSTIMESTAMP() - the statement's instant in the session's zone, as TIMESTAMP_LTZ.
Serializable snapshot of table row data
Where per-table row data goes during a state snapshot and comes from during a restore.
Interface for table-valued functions
Which arguments each table function actually takes, and how Snowflake refuses the rest.
TABLE FUNCTION operator - executes table-valued functions.
What a table function's parameter will take.
One table-level lock a transaction is HOLDING, as
SHOW LOCKS reports it (live-verified):
partition-rewriting DML — UPDATE, DELETE (even one matching no rows), MERGE, TRUNCATE — registers
a PARTITIONS lock on the table's fully qualified name, one row per (transaction, table)
however many statements touch it, released when the transaction ends.Serializable snapshot of table metadata
Immutable timestamped snapshot of the table for time travel.
Represents a Snowflake TAG - used for object categorization and metadata management
Tags can be applied to databases, schemas, tables, and other objects for governance and organization
Implemented by catalog objects (and columns) that can carry Snowflake object tags applied via
ALTER <object> SET TAG <tag> = '<value>' / ALTER <object> UNSET TAG <tag>.The INFORMATION_SCHEMA.TAG_REFERENCES(object_name, object_domain) TABLE FUNCTION — the tags
attached to one object, as
SELECT … FROM TABLE(INFORMATION_SCHEMA.TAG_REFERENCES('db.schema.t', 'TABLE')).Serializable snapshot of a TAG definition (allowed values + comment).
How Snowflake stores a dynamic table's TARGET_LAG: the input is canonicalized, not echoed.
Represents a Snowflake Task - Scheduled SQL execution
The outcome of a single
TaskExecution run — TaskExecutionState.SUCCEEDED or TaskExecutionState.FAILED.Interface for executing SQL statements for tasks
INFORMATION_SCHEMA.TASK_HISTORY() table function
Syntax: SELECT * FROM TABLE(INFORMATION_SCHEMA.TASK_HISTORY())
SELECT * FROM TABLE(INFORMATION_SCHEMA.TASK_HISTORY(TASK_NAME => 'my_task'))
SELECT * FROM TABLE(INFORMATION_SCHEMA.TASK_HISTORY(RESULT_LIMIT => 100))
Schedules and executes tasks
Serializable snapshot of a TASK — its definition and STARTED/SUSPENDED state, restored as-is.
Task state enum - represents whether a task is running or suspended
What started a task run, as TASK_HISTORY's
SCHEDULED_FROM reports it.How
getString renders a temporal cell, per DECLARED type — measured against a real account's
driver, which is the thing a caller compares Frostlake to:Whether a statement creates a TEMPORARY object, and which kind Snowflake calls it — the question an
owner's rights stored procedure has to answer before running a handler's statement.
A built-in that reads its arguments as text, and therefore refuses a statically OBJECT- or
ARRAY-typed value in EVERY argument position.
TIMEADD(unit, amount, datetime) — alias of DATEADD.
TIMEDIFF(unit, start, end) — alias of DATEDIFF.
TIME(<expr>) — the TIME synonym, which is not TO_TIME.TIME_SLICE(t, n, unit [, 'START'|'END']) — the start (default) or end of the n-unit bucket
containing t.
The one conversion behind TO_TIMESTAMP and its TRY_ twins, handing back the value the call's flavour
holds: a TIMESTAMP_NTZ is a wall clock, a TIMESTAMP_LTZ the instant the input names shown in the
session's zone, and a TIMESTAMP_TZ that instant at an offset it keeps.
Which timestamp flavour a FUNCTION NAME asks for.
Snowpark's
Timestamp type.Snowpark's
Time type.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.
TO_BINARY(string [, format]) — decodes the input string into a
BinaryValue using
format (default HEX).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).
TO_DOUBLE(expr [, format]).
TO_FILE(stage_and_path) / TO_FILE(stage, relative_path) / TO_FILE(metadata) —
builds the file-metadata object that is a FILE value.TO_OBJECT(expr) — NULL (or JSON null) returns NULL; an OBJECT (or a VARIANT containing an OBJECT) is
returned as an object.
One counter of a
TopKSummary: a value, how many times the summary has counted it, and the
tick of the summary's clock at which it was last touched — the tie-breaker every ordering rule of
the APPROX_TOP_K family reads.The Space-Saving summary behind the APPROX_TOP_K family: a bounded set of (value, count) counters
that names the most frequent values of a stream without holding every distinct one.
TO_QUERY table function — compiles a SQL text into a query and returns its result set:
SELECT * FROM TABLE(TO_QUERY('SELECT ...')).TO_TIME(expr [, format]).
TO_TIMESTAMP / TO_TIMESTAMP_LTZ / TO_TIMESTAMP_TZ.
TO_UUID(s) — the canonical lowercase form of a UUID string.
TO_VARIANT(expr) — wraps a value as a typed VARIANT.
TO_XML(variant) — the XML text of a semi-structured value.
Transaction state enum - represents the state of a transaction
Per-transaction buffer of pending changes — the foundation of the deferred-apply / READ COMMITTED model
(see
docs/acid-snowflake-plan.md).A TRANSIENT object keeps at most ONE day of history, and asking for more is refused.
Routes Truffle/polyglot log output into SLF4J — the "configure logging using the polyglot
embedding API" option: installed as the
engine log
handler, so GraalVM's warnings and diagnostics land in the engine log (with per-language logger
names under the polyglot. prefix) instead of being printed to stderr.TRY_BASE64_DECODE_BINARY(string) — BASE64_DECODE_BINARY that returns NULL instead of erroring.
Catalog entry for TRY_CAST.
TRY_DECRYPT — DECRYPT that returns NULL instead of erroring on a bad key or payload.
TRY_DECRYPT_RAW — DECRYPT_RAW that returns NULL instead of erroring.
TRY_HEX_DECODE_BINARY(string) — HEX_DECODE_BINARY that returns NULL instead of erroring.
TRY_PARSE_IP — PARSE_IP that returns NULL instead of erroring on invalid input.
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.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.TRY_TO_DOUBLE(expr [, format]) —
ToDouble answering NULL where TO_DOUBLE fails on the value.TRY_TO_FILE(...) — ToFile with every failure turned into NULL.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.
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.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.TRY_TO_UUID(s) — TO_UUID that returns NULL instead of erroring.
TRY_VALIDATE_UTF8(x) — the input as a string when its bytes are valid UTF-8, else NULL.
Row-constructor
IN test: (a, b) IN (SELECT x, y ...),
(a, b) IN ((1, 2), (3, 4)), or the type-invalid flat spelling (a, b) IN (1, 2).Type category enum - represents the category of a data type
A JSON string node that remembers the TYPED value it was rendered from.
A VECTOR living inside a VARIANT: an array of its ELEMENTS, still knowing it is a vector.
Routes a JVM-handler UDF's console output (
System.out/System.err written on the
invoking thread) into the engine log instead of the embedder's console.The
PrintStream type UdfConsoleCapture installs over System.out/
System.err — a plain auto-flushing stream whose distinct class lets the capture recognize (via
instanceof) whether its wrapper is still installed after a test harness swaps the system
streams.The
OutputStream behind UdfConsolePrintStream: bytes written by a thread inside a
UDF handler (UdfConsoleCapture.isCapturing()) are buffered per thread and relayed to the
engine log line by line; every other write passes straight through to the original stream.The implementation language (runtime) of a UDF or stored procedure, as declared by
LANGUAGE ….Executes UDFs and stored procedures of one
UdfLanguage.The type a SQL UDF's parameter carries INSIDE the body, which is not always the type it was declared
with.
Registry of the
UdfLanguageRuntime providers on the classpath, discovered once at first
use.Represents a unary operation (e.g., NOT x, -5, EXISTS(...))
Represents a unary operation (e.g., NOT x, -5, EXISTS(...))
The operator of a
UnaryOperationExpression — logical NOT, arithmetic NEGATE, or EXISTS.A
:name inside a scripting block naming no declared variable — the same "invalid identifier"
refusal as any other unresolvable name, and deliberately worded identically.The VARIANT
undefined element — the third null of Snowflake's semi-structured layer, alongside
SQL NULL and the JSON null.UNIFORM(min, max [, gen]) — a uniformly random value in the range.
One UNIQUE constraint, spanning one or more columns.
Serializable form of a table-level
UniqueConstraint for catalog snapshots — the name and the
column span a per-column UNIQUE flag cannot carry on its own.The INFORMATION_SCHEMA views for objects this engine does not model — semantic views, native
apps, Cortex services, backups and snapshots, replication, sharing, container services, and the
rest.
Live's refusal of a correlated subquery whose shape its planner cannot evaluate ("Unsupported subquery
type cannot be evaluated at line L, position P").
Represents a Snowflake-compatible user
Represents a user-defined exception declared in procedural code
Serializable snapshot of user metadata
SYSTEM$USER_TASK_CANCEL_ONGOING_EXECUTIONS('task_name') — cancels the runs of a task that
are in flight and returns a one-column status row describing what happened.The one implementation of
SYSTEM$USER_TASK_CANCEL_ONGOING_EXECUTIONS('task_name'), shared
by the three surfaces that can reach it: the registered table function, and the two expression
paths (SELECT SYSTEM$…() and SET v = SYSTEM$…()).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.
Snowflake's UUID type: a 128-bit value held and shown as its canonical lower-case text,
1b4e28ba-2fa1-11d2-883f-0016d3cca427.VALIDATE_UTF8(x) — the input as a string when its bytes are valid UTF-8.
Pure value-casting helpers extracted from
ExpressionEvaluatorVisitor: SQL CAST/coercion of a
value to a target type, NUMBER(p,s) scale/precision enforcement, integer rounding, and hex decoding.Stateless value/ordering comparison helpers extracted from
QueryExecutor.The closed interval of values an exact-numeric expression can take, as the account's planner
reasons about it: a stored column's interval is its statistics (the least and greatest value in the
whole table, whatever a WHERE keeps), a literal's is itself, and arithmetic widens it by interval
rules.
Accumulator for
Variance.Stub implementation of Snowflake Snowpark Variant type for inline Java procedures.
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.
A VARIANT converted to BOOLEAN — by
::BOOLEAN, CAST or TO_BOOLEAN — on the account's terms: it
converts only when it holds a boolean.Renders a semi-structured value the way Snowflake displays one: indented by JSON_INDENT spaces,
compact at zero.
The VARIANT JSON null (
NULL_VALUE) versus SQL NULL boundary.The JSON TEXT of a semi-structured value in the account's own spelling, which differs from the
engine's canonical text in exactly one place — the DOUBLE family.
A VARIANT read as a number wherever a number is needed: its JSON number, its JSON string when that
spells one, and a JSON boolean as 1 / 0.
How two VARIANT values order and compare, live-verified member by member.
The canonical JSON text a VARIANT stores.
Snowpark's
Variant type.The VARIANT
undefined boundary — where a SQL NULL becomes an UndefinedNode and where the
sentinel must be told apart from a JSON null.Runtime value of the SQL semi-structured family (VARIANT / OBJECT / ARRAY): canonical JSON text
plus a lazily parsed tree.
Accumulator for
VarPop.Which element-wise reduction a
VectorAggregateAccumulator applies across the group's rows.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).VECTOR_COSINE_SIMILARITY(v1, v2) — the cosine of the angle between two vectors,
Σ(a·b) / (|a|·|b|), as a FLOAT (float64).The element type of a
VectorType — the two spellings Snowflake allows in
VECTOR(FLOAT, n) / VECTOR(INT, n).Argument handling shared by the VECTOR functions.
VECTOR_INNER_PRODUCT(v1, v2) — the dot product Σ(a·b), as a FLOAT (float64).VECTOR_L1_DISTANCE(v1, v2) — the Manhattan distance Σ|a−b|, as a FLOAT (float64).VECTOR_L2_DISTANCE(v1, v2) — the Euclidean distance sqrt(Σ(a−b)²), as a FLOAT
(float64).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.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.VECTOR_NORMALIZE(v) — the unit vector v / |v|, always a VECTOR(FLOAT, n).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).VECTOR_TRUNC(v, n) (alias VECTOR_TRUNCATE) — the vector's FIRST n dimensions,
keeping the element type.Snowflake's
VECTOR(element_type, dimension) type; values are VectorValue.Runtime value of Snowflake's
VECTOR(FLOAT|INT, n) type: a fixed-length list of 32-BIT
elements plus the element type.Serializable snapshot of view metadata
Builds and evaluates SQL expressions on behalf of
SQLCommandVisitor: the procedural
expression AST (buildExpression), constant / DDL-time evaluation (evaluateExpression),
and the SYSTEM$ built-in family (evaluateSystemFunc).A UDF's volatility:
Volatility.VOLATILE (the default — may return different results across calls) or
Volatility.IMMUTABLE (a pure function of its arguments).One record in the write-ahead log.
Kind of
WalRecord in the write-ahead log: the statements of one committed transaction, or a
checkpoint marker that records a durable state snapshot every preceding record folds into.Callback the
TransactionManager invokes when a transaction commits successfully, handing over the
committed transaction's mutating SQL statements so a durability layer (the engine's write-ahead log) can
append them as one atomic, fsync'd record.Which statements belong in the write-ahead log, decided from the PARSE TREE.
Represents a Snowflake Compute Warehouse
Warehouses provide compute resources for query execution
Refusing a statement that names a warehouse which is not there.
Demonstration of Compute WAREHOUSES - Virtual compute clusters for query execution
Warehouse size enum - represents the compute capacity of a warehouse
Serializable snapshot of warehouse metadata
Warehouse state enum - represents the operational state of a warehouse
WEEKISO(t) — ISO-8601 week number.
The running count, mean and sum of squared deviations of a double series — Welford's update,
merged with Chan's formula — which the variance family uses over EXACT inputs.
Evaluation mode for WHERE clause operator
WHERE clause operator - filters rows based on a predicate expression.
The aggregates that, used as a WINDOW, may only see the WHOLE partition.
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.How many arguments each window function takes, and live's two sentences for a call that gets it
wrong.
A window function call (one carrying an
OVER clause) that appears nested inside a larger
expression — e.g.Shared logic for Snowflake window functions.
The window functions
WindowFunctionEvaluator implements itself, i.e. the names that are valid
in front of an OVER (...) clause without being registered in the FunctionRegistry
scalar / aggregate maps.First-occurrence 1-based position, RANK and DENSE_RANK of every row of ONE sorted window
partition, built in a single pass over the partition.
Reads a response's rows off the wire token by token, so a number's own text decides its Java form.
Append-only write-ahead log — a logical (redo) log of committed transactions.
A COPY-ON-FIRST-MUTATION statement savepoint over a
TransactionWriteSet.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).XML staged-file reader (JDK DOM — no external dependency).
Snowflake's XML-in-VARIANT model.
YEAROFWEEK(t) — the year the week belongs to (engine week = ISO week).
YEAROFWEEKISO(t) — the ISO week-based year.
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).