Kater CLI Find and understand
kater references
Lists everything that reads a field.
For each model, it shows where its SQL names the field, and which of its fields read it. Use it before you rename or remove a field, to see what the change reaches. Nothing runs on the warehouse.
Examples
# Go to the connection's shared modelscd connections/snowflake_prod_connection/modeling# List what reads the Spend measure of the shared ad_reporting modelkater references sum__spend --relation semantic.ad_reporting# List only the fields that name it, not the ones that read it through another fieldkater references sum__spend --relation semantic.ad_reporting --direct# Go to the ad_reporting workspacecd ../workspaces/ad_reporting# List what reads the Conversions measure of the workspace's rootkater references sum__conversions --relation workspace.ad_reporting# List only the fields that name the Spend field of the spend_by_platform querykater references sum__spend --relation query.spend_by_platform --directArguments
Options
It also takes the global options --json, --kater-root, --scope and --help.
Where to run it
Name a shared model’s field from its connection’s modeling folder. Name the field of a workspace’s root, or of one of its queries, from the workspace.
What it lists
- Each model that reads the field, by its file.
- Each place where the model’s SQL names the field, as
LINE:COLUMN, counted from 1. - Each field of the model that reads the field, and how, such as
valueorfilter. It also says when a field reads it only through another field. - A count at the end, of the models that read it.
When more than 1,000 fields read it, the list is cut, and --json has the first 1,000. --json returns the references.list answer. In it, each place is a range of zero-based lines and UTF-16 characters, with each file’s revision.
What it leaves out
- It lists only the models that you can read.
- Nothing in a brainstorm folder counts, except a copy’s own queries for a field in that copy.
- It does not list dashboards, apps and Explore yet.