Kater CLI Make and compare
kater compare
Compares two answers and shows where they differ, or compares an app's figures for two weeks.
Use --left and --right to check that a changed query, or a copy of a workspace, still returns the same rows. Each pair runs on the warehouse as one statement that returns only the rows that differ. Use --app and --periods to see how each figure of an app moved from one week to the next, and which figures stand out.
Examples
# Go to a connection in your local copy of Kater contentcd connections/snowflake_prod_connection# Check that two saved queries return the same spend by platform and currencykater compare --left workspaces/ad_reporting/query_contracts/spend_by_platform.sql --right workspaces/ad_reporting/query_contracts/spend_conversion_value_by_platform.sql# Compare every query of the workspace with your brainstorm copy of itkater compare --left workspaces/ad_reporting --right users/you@example.com/brainstorm/promote_roas/workspaces/ad_reporting# Compare one query with your copy of it, over the last 6 complete monthskater compare --left workspaces/ad_reporting/query_contracts/paid_media_spend_trend.sql --right users/you@example.com/brainstorm/promote_roas/workspaces/ad_reporting/query_contracts/paid_media_spend_trend.sql --parameter is_within_last__union__date_day=6# Compare the first two statements of a scratch filekater compare --left users/you@example.com/brainstorm/promote_roas/spend_check.sql#0 --right users/you@example.com/brainstorm/promote_roas/spend_check.sql#1# Compare an app's figures for the weeks of Sep 28 and Oct 5kater compare --app app_129abe379bbf43b5a7012c252157e634 --periods 2026-09-28,2026-10-05Options
It also takes the global options --json, --kater-root, --scope and --help.
What each pair says
| Verdict | What it means |
|---|---|
same | Every compared row and column matches. |
different | Some rows differ. It gives the first 50 differences. A difference is a value that differs, or a row that only one side has. It can also be a key that more than one row on one side has. |
only_left, only_right | Across two workspaces, a query that only one of them has. |
refused | A side could not run, and the message says why. For example, it does not compile, or you cannot read it. The other pairs still run. |
The command prints each pair’s verdict and message, and its first 10 differences. The last line counts the pairs by verdict. --json gives every difference, and the first 10 rows that both sides have alike. A difference does not fail the command. It exits with 1 only when no pair differs and at least one pair is refused.
How it compares
- Defaults apply. Each side runs with its own filters on and each parameter at its default, except the parameters that
--parametersets. - Columns pair by name, after
--columngives a left column its right name. A column that only one side returns is listed, and not compared. - Numbers compare at the decimal places that their format shows. A number with no format must match to one part in a billion.
- Paths that start with
connections/are from the content root. Other paths are relative to the folder you are in, or to--kater-rootwhen you give it.
What it can compare
- Queries compare from connection workspaces and from your own workspaces. A query in another person’s private workspace is refused.
- Scratch statements run as
kater showruns them. - One connection. Both sides must read the same connection. A side that compare does not run, such as custom SQL, is refused.
- A copy and its original. Across a brainstorm copy and the workspace that it copies,
changedmarks each query that the copy changed. See Workspace copies.
An app’s figures
With --app, Kater compares each figure that the app’s page shows, at each row it shows, for the two weeks. It reads the weeks that Kater keeps for the app, not the warehouse, unless you give --refresh. Each figure gets these checks:
- Change. How far the change between the two weeks is from the figure’s usual weekly change.
- Value. How far the second week’s value is from the figure’s normal range over the weeks before.
- Size. How much of the week’s total the move is, for a figure that adds up across rows.
- Same week last year. The change from the same week one year before.
- Decisions. Where the value is against each open decision on the app’s timeline that watches the figure.
The command prints the two weeks and how many figures stand out. Then come the figures that stand out, the strongest first, each with its two values, its change, the sentences of its checks and its series key. Then the other figures, one line each. A figure that moves with a figure above it is counted, and --json lists it. The last lines say when Kater checked the weeks and when it last read them from the warehouse.
When Kater has not checked the two weeks yet, the command starts the check and waits for it. It names the job, and while it waits it prints a line after 1 second and again every 10 seconds:
15:31:03 Kater has not checked these 2 weeks yet. Started the check (job 7f3a2c).15:31:04 Waiting for the check (job 7f3a2c). 1s15:31:14 Waiting for the check (job 7f3a2c). 11sA check that reads stored weeks ends in seconds. A first read of an app’s weeks, or --refresh, waits on the warehouse. The command waits 15 minutes at most, then stops and the check keeps running: run the same command again to read it. Ctrl-C also leaves the check running, and the command exits with 130. A check that fails exits with 1 and says why. Only an app that you can read is checked.
Use the series key with kater figure trend to keep one figure’s weeks as an answer.
Through the MCP
Through the Kater MCP, the result’s app_url opens it in Kater. A copy and its original open on the copy’s compare view, at the query that the chat’s card opens on. Any other comparison opens at the left side’s place.