Skip to main content
On this page

Kater CLI Build an analysis filter

kater filter move

Moves a query's filter to its workspace's root, as Move to workspace does.

Every query of the workspace then has the filter. Each other query that writes the same condition reads the root’s filter in place of its copy. Run it without --write first: it shows what moves and what the check on the warehouse finds. See Promotion and verification.

Examples

Terminal window
# Go to the ad_reporting workspace in your local copy of Kater content
cd connections/snowflake_prod_connection/workspaces/ad_reporting
# Show what moves and what the check finds, and write nothing
kater filter move paid_media_spend_trend is_within_last__union__date_day
# Move the filter, while it is still the proposal of that line
kater filter move paid_media_spend_trend is_within_last__union__date_day --revision 9f2c41d7 --write

Arguments

ArgumentDescription
<place>The query, as <workspace>/<name>, its key or its id. Never a file.
<name>The query’s filter, by its name.

Options

OptionDescription
--writeMoves the filter. Without it, the command shows what moves and what the check on the warehouse finds, and writes nothing.
--revision <revision>Moves the filter only while it is still the proposal that a line without --write gave, by its revision.
--confirm-uncheckedMoves the filter even when the check on the warehouse could not check the move. A check that finds different rows always stops the move.

It also takes the global options anywhere on the line, and --help.

What moves

A filter moves up only. No command moves a workspace filter down to one query, since every other query would lose it.

  • Copies go. Another query of the workspace that writes the same condition, under any name, loses its copy, since it now reads the root’s filter. The line without --write names each copy by its label and its name, and the query by its label: Takes away the copy West only (west_only) from Top West.
  • A copy stays only where its rows need it. A required filter in the root covers every copy. An optional one covers an optional copy with the same switch. Any other copy stays, and the command says why: Keeps the copy EMEA only (emea_only) in Top Emea. EMEA only is required, and EMEA is optional. A reader could switch it off.
  • The root has the condition already. When the root writes the same condition under another name, the command refuses the move and names the copy to remove.
  • The rows stay. Before it writes, the command runs each query that the move reaches on your warehouse, before and after the move. When a query returns other rows, the command writes nothing.

See also