This reference documents the complete set of Chalk SQL functions for federated queries across data sources, offline stores, and the Chalk catalog.
Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.min argument. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.max argument. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.array using a callback function predicate.Type parameters. T means matching inputs and outputs use the same type.
array or list. T means matching inputs and outputs use the same type.predicate argument. T means matching inputs and outputs use the same type.Type parameters. K is the key type of the input map.
SELECT array_join(array_constructor('a', 'b', 'c'), ',');
| array_join(array_constructor('a', 'b', 'c'), ',') |
| ------------------------------------------------- |
| a,b,c |element in an array.Type parameters. T means matching inputs and outputs use the same type.
SELECT array_position(array_constructor('a', 'b', 'a'), 'a');
| array_position(array_constructor('a', 'b', 'a'), 'a') |
| ----------------------------------------------------- |
| 1 |array and returns the accumulated value.Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type. V is the value type of the input map.
array or list. T means matching inputs and outputs use the same type.inputFunction argument. T means matching inputs and outputs use the same type. U is a second generic value type.outputFunction argument. V is the value type of the input map. U is a second generic value type.Type parameters. T means matching inputs and outputs use the same type. S is the callback state type. R is the callback result type.
arg3 argument. T means matching inputs and outputs use the same type. R is the callback result type. S is the callback state type.Type parameters. E is the element type of the input array or list.
SELECT array_slice(array_constructor(1, 2, 3, 4), 2, 3);
| array_slice(array_constructor(1, 2, 3, 4), 2, 3) |
| ------------------------------------------------ |
| [2, 3, 4] |array in ascending order, optionally using a key extraction function.Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type.
SELECT array_sort(array_constructor(3, 1, 2));
| array_sort(array_constructor(3, 1, 2)) |
| -------------------------------------- |
| [1, 2, 3] |array in descending order, optionally using a key extraction function.Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type.
SELECT array_sort_desc(array_constructor(3, 1, 2));
| array_sort_desc(array_constructor(3, 1, 2)) |
| ------------------------------------------- |
| [3, 2, 1] |Type parameters. V is the value type of the input map. K is the key type of the input map.
SELECT cardinality(array_constructor(1, 2, 3));
| cardinality(array_constructor(1, 2, 3)) |
| --------------------------------------- |
| 3 |array or map.Type parameters. E is the element type of the input array or list. K is the key type of the input map. V is the value type of the input map.
SELECT element_at(array_constructor('a', 'b'), 2);
| element_at(array_constructor('a', 'b'), 2) |
| ------------------------------------------ |
| b |Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
SELECT greatest(3.0, 7.0, 5.0);
| greatest(3.0, 7.0, 5.0) |
| ----------------------- |
| 7.0 |SELECT greatest(3, 7, 5);
| greatest(3, 7, 5) |
| ----------------- |
| 7 |Type parameters. T_ord can be any orderable type, such as a number, string, date, timestamp, or boolean.
SELECT least(3.0, 7.0, 5.0);
| least(3.0, 7.0, 5.0) |
| -------------------- |
| 3.0 |SELECT least(3, 7, 5);
| least(3, 7, 5) |
| -------------- |
| 3 |SELECT array_mode(array_constructor(1, 2, 2, 3));
| array_mode(array_constructor(1, 2, 2, 3)) |
| ----------------------------------------- |
| 2 |function to transform paired elements.Type parameters. T means matching inputs and outputs use the same type. U is a second generic value type. R is the callback result type.
string, binary, array, or map.Type parameters. V is the value type of the input map.
SELECT length('chalk');
| length('chalk') |
| --------------- |
| 5 |SELECT length(array_constructor(1, 2, 3));
| length(array_constructor(1, 2, 3)) |
| ---------------------------------- |
| 3 |SELECT starts_with('feature_store', 'feature');
| starts_with('feature_store', 'feature') |
| --------------------------------------- |
| true |length.SELECT substr('feature_store', 9);
| substr('feature_store', 9) |
| -------------------------- |
| store |SELECT substr('feature_store', 1, 7);
| substr('feature_store', 1, 7) |
| ----------------------------- |
| feature |SELECT substr('feature_store', 9);
| substr('feature_store', 9) |
| -------------------------- |
| store |SELECT substr('feature_store', 1, 7);
| substr('feature_store', 1, 7) |
| ----------------------------- |
| feature |SELECT starts_with('feature_store', 'feature');
| starts_with('feature_store', 'feature') |
| --------------------------------------- |
| true |Type parameters. K is the key type of the input map. V is the value type of the input map.
K is the key type of the input map. V is the value type of the input map.Type parameters. K is the key type of the input map. V is the value type of the input map.
K is the key type of the input map. V is the value type of the input map.df1 (numerator degrees of freedom) and df2 (denominator degrees of freedom) parameters for the cumulative probability (p): P(N < n). The numerator and denominator df parameters must be positive real numbers. The probability p must lie on the interval [0, 1].