Kater CLI Find and understand model
kater model
Finds, explains and changes the models in your Kater content, and their fields.
A model is anything Kater compiles from SQL: a dataset, a semantic model, a workspace’s root, a query or a chart. Only promote and edit change your files, and only check-join and promote run queries on your warehouse. To see a model’s rows, use kater show.
Commands
| Command | What it does |
|---|---|
kater model explain | Explain how a model’s fields are computed. |
kater model promote | Move a query’s field to its workspace’s root. |
kater model list | List the models you can read, with their files. |
kater model fields | List the fields a model has and the ones it can read. |
kater model show | Show one model’s saved contract, by its name. |
kater model describe | Show the saved contract of every model you select. |
kater model search | Find models and fields by name, label or description. |
kater model inspect | Check a model file for problems. |
kater model edit | Change a model’s fields, filters or relationships. |
kater model check-join | Count a join’s matches on the warehouse. |
kater model joinable | List the models this one can join on fields it has. |
Which models a command works on
A command works in one workspace, or in one connection’s modeling folder. Kater finds it in this order:
- A path you give. This is
--scope, or the file or folder that the command takes, such asPATH,--pathor a path in--select. - Your saved scope. This is the scope that
kater scope usesaved. - The folder you are in. Go into a workspace, such as
connections/snowflake_prod_connection/workspaces/ad_reporting, or into a connection’smodelingfolder.
A path that starts with connections/ is from the content root. Any other path is relative to the folder you are in. In the Files terminal, the folder you are in always counts, and a saved scope does not.
How to name a model
An option that takes a model, such as --relation, takes its name or its typed address. A typed address is the model’s kind and its name, such as semantic.ad_reporting, workspace.ad_reporting or query.spend_by_platform. Use the typed address when two models have the same name. --select also takes the id that kater model list shows. See Addresses and names.
Examples
# Go to the ad_reporting workspacecd connections/snowflake_prod_connection/workspaces/ad_reporting# List the models in the workspacekater model list# Find the models and fields that mention spendkater model search spend# Explain how the Spend measure of the workspace's root is computedkater model explain sum__spend --relation workspace.ad_reporting# Show 5 rows of the spend_by_platform querykater show --select query.spend_by_platform