On this page
Kater CLI Build an analysis query
kater query label
Sets the label of one column that a saved query returns.
Kater writes the label into the query’s SQL, such as AS "Spend", and compiles the query again. The query’s numbers do not change.
Examples
# See the columns of spend_by_platform, each with its reference, and the query's revisionecho '{"source": {"model_type": "query", "namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}, "name": "spend_by_platform"}}' | kater chart describe --request-file -# Set the label of one column, with the request in label.jsonkater query label --request-file label.jsonArguments
Options
It also takes the global options --json, --kater-root, --scope and --help.
The request
| Key | What it holds |
|---|---|
source | The query, such as {"model_type": "query", "namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}, "name": "spend_by_platform"}. |
field | The column, as the reference that kater chart describe gives for it. Copy it as it is. |
label | The new label, from 1 to 256 characters. |
expected_revision | The query’s sourceRevision from kater chart describe. |
inputs | Parameter values and the filters to turn on, as in a run’s inputs: parameters and filters. |
snapshot_id | The id of rows already read for the query. The answer gives those rows back with the new label. |
When Kater refuses it
- The query changed since
kater chart describegave its revision. - The query has edits in an editor that are not saved.
- The label cannot be written without a change to the query’s compiled SQL.