Skip to main content
On this page

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

CommandWhat it does
kater model explainExplain how a model’s fields are computed.
kater model promoteMove a query’s field to its workspace’s root.
kater model listList the models you can read, with their files.
kater model fieldsList the fields a model has and the ones it can read.
kater model showShow one model’s saved contract, by its name.
kater model describeShow the saved contract of every model you select.
kater model searchFind models and fields by name, label or description.
kater model inspectCheck a model file for problems.
kater model editChange a model’s fields, filters or relationships.
kater model check-joinCount a join’s matches on the warehouse.
kater model joinableList 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:

  1. A path you give. This is --scope, or the file or folder that the command takes, such as PATH, --path or a path in --select.
  2. Your saved scope. This is the scope that kater scope use saved.
  3. The folder you are in. Go into a workspace, such as connections/snowflake_prod_connection/workspaces/ad_reporting, or into a connection’s modeling folder.

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

Terminal window
# Go to the ad_reporting workspace
cd connections/snowflake_prod_connection/workspaces/ad_reporting
# List the models in the workspace
kater model list
# Find the models and fields that mention spend
kater model search spend
# Explain how the Spend measure of the workspace's root is computed
kater model explain sum__spend --relation workspace.ad_reporting
# Show 5 rows of the spend_by_platform query
kater show --select query.spend_by_platform

See also