Skip to main content
On this page

Kater CLI Find and understand operation

kater operation list

Lists the operations that each field of a model offers, field by field and family by family.

With --field and --operation, it shows one operation’s parameters and the exact item that kater model edit --operations takes. Nothing changes until you send that item.

Examples

Terminal window
# Go to the ad_reporting workspace
cd connections/snowflake_prod_connection/workspaces/ad_reporting
# List the operations that each field of the spend_by_platform query offers
kater operation list query_contracts/spend_by_platform.sql
# List the window operations of the Spend field
kater operation list query_contracts/spend_by_platform.sql --field sum__spend --family windows
# Show the parameters and the target of the windows.lag operation on Spend
kater operation list query_contracts/spend_by_platform.sql --field sum__spend --operation windows.lag

Arguments

ArgumentDescription
<path>Optional. The model’s file. Or a workspace folder, with --model to select the model in it. Give PATH, --model or both.

Options

OptionDescription
--model <model>The model, for a file that declares several, or in place of PATH, such as query.spend_by_platform.
--text-file <file>Text to read in place of the saved file, such as an editor’s unsaved changes. Kater still reads it as the file at PATH. - reads stdin.
--at <line>:<character>The cursor’s place in the file, counted from 0, in UTF-16 code units. Kater selects the model at that place.
--field <field>Lists only this field’s operations, by the field’s name. Write alias.name for a field of a model that this one reads, such as ad_reporting.sum__spend. See Field names.
--fields-of <fields>Whose fields to list. Give active for the model’s own fields, source for the fields of the models it reads, or all for both. The default is all.
--family <family>Lists only the operations of this family: aggregations, calculate_at, comparisons, derive, field, filter_by_this_number, filters, format, sort, timeframes or windows.
--operation <id>One operation of --field, such as windows.lag. It shows the operation’s parameters, the target that kater model edit --operations takes, and the fields each choice offers. It needs --field.

It also takes the global options --json, --kater-root, --scope and --help.

What it shows

Without --operation, each field shows its operation names by family, and the operations that are set on it already. With --operation, it shows each parameter, marked (required) when you must give it, and the target to send. Put the target, the operation_id and your parameters into one item of a JSON array. Then give the array to kater model edit with --operations.

Field names

--field compares names as the connection’s warehouse compares them. In Snowflake, spend finds SPEND, and "Campaign" finds only Campaign. In DuckDB, case does not matter, quoted or not.

See also