Kater SQL Language
Kater SQL reference
Every Kater addition to your warehouse's SQL: declarations, EVAL, joins, filters, functions, directives and parameters.
Kater SQL is your warehouse’s own SQL with Kater’s additions. Write Snowflake SQL on a Snowflake connection and DuckDB SQL on a DuckDB connection: warehouse_type in connection.yaml sets the dialect, and the compiler refuses a function your warehouse does not have and says what to write instead. The additions are below.
Language
| Page | What it covers |
|---|---|
| File shape | How a Kater SQL file holds its frontmatter and its statements, and what happens when you save it. |
| Addresses and names | How a statement names a warehouse table, a dataset, a model, a workspace or a query, and the rules for each name. |
| Joins | RELATIONSHIP and REQUIRED_RELATIONSHIP, the named joins of Kater SQL. |
| Comment directives | The comments that give a field its description, AI context, format, tags and business questions. |
| Parameters | How a query reads a value that a reader supplies, on Snowflake and on DuckDB. |
| What each model allows | Which Kater SQL calls each kind of model, query and test can hold. |
Functions
Each function has its own page, with its syntax, its arguments, what it returns, and an example with the rows that Kater gave. Kater SQL’s own calls come first:
| Family | What it covers |
|---|---|
| Field declarations | DIMENSION, MEASURE, CUSTOM_CALCULATION, NOT_ADDITIVE_ACROSS and EXCEL, which make new fields. |
| EVAL and its modifiers | EVAL, which works out a measure, and CLEAR, REMOVE, SET, SET_CUSTOM and CURRENT, which change its context. |
| Filters | OPTIONAL_FILTER, which a reader switches on, and REQUIRED_FILTER, which always applies. |
| Calculation context | TOTAL, SHARE_OF_TOTAL, VALUE_FOR and the other calls that work a measure out again in another context. |
A KATER__ function is a call that the compiler turns into your warehouse’s SQL. The menus write them for you, and you can write them yourself in any Kater SQL file. Each KATER__ function’s page also shows the SQL it compiles to.
- Summary of functions lists each family of functions.
- All functions (alphabetical) lists every function by name.