Package dev.frostlake.functions.table
Class SplitToTable
java.lang.Object
dev.frostlake.functions.TableFunction
dev.frostlake.functions.table.SplitToTable
SPLIT_TO_TABLE — splits a string into one row per part, as SEQ, INDEX and VALUE.
Positional only. Snowflake documents the two parameters as STRING and DELIMITER but does
not accept them by name: SPLIT_TO_TABLE(STRING => 'a,b', DELIMITER => ',') is refused
with unexpected argument [STRING] at position 1. Both arguments are required — there is no
default delimiter. Those refusals are raised at compile time before this runs.
The measured row rules:
- SEQ numbers the INPUT RECORD, not the part: every row of one call carries the same SEQ, and it starts at 1. INDEX is the 1-based position of the part.
- A NULL string or a NULL delimiter yields NO rows.
- An EMPTY delimiter does not split at all — the whole string comes back as one row.
- An empty string yields one row whose VALUE is empty, and empty parts between consecutive delimiters are kept, leading and trailing ones included.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe positional formSPLIT_TO_TABLE(string, delimiter)— the only one Snowflake takes.The named-argument entry point of theTableFunctioncontract.voidvalidateArgs(Map<String, Object> namedArgs) Validate the arguments passed to the functionMethods inherited from class dev.frostlake.functions.TableFunction
getName
-
Constructor Details
-
SplitToTable
public SplitToTable()
-
-
Method Details
-
execute
The positional formSPLIT_TO_TABLE(string, delimiter)— the only one Snowflake takes.- Overrides:
executein classTableFunction
-
execute
The named-argument entry point of theTableFunctioncontract. SQL never reaches it — a named call is refused while the statement is compiled — so it serves callers inside the engine, which pass the two parameters under their documented names.- Specified by:
executein classTableFunction
-
validateArgs
Description copied from class:TableFunctionValidate the arguments passed to the function- Specified by:
validateArgsin classTableFunction
-