Skip to main content
On this page

Kater CLI Build an analysis query

kater query sandbox

Opens a saved query in a new scratch file in your brainstorm folder.

There you can try changes, and the query stays as it is. The scratch file keeps the query’s SQL, its parameters and its chart, and reads the workspace by its full path.

Examples

Terminal window
# Open the spend_by_platform query in a new scratch file, with the request in sandbox.json
kater query sandbox --request-file sandbox.json
# Send the same request on standard input
echo '{"namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}, "document": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting/query_contracts/spend_by_platform.sql"}, "title": "Spend by platform"}' | kater query sandbox --request-file -

Arguments

ArgumentDescription
<path>Optional. In place of --request-file: the workspace, the query file or the chart file the request names.

Options

OptionDescription
--request-file <file>The JSON request. - reads it from standard input. See The request.

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

The request

sandbox.json
{"namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}, "document": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting/query_contracts/spend_by_platform.sql"}, "title": "Spend by platform"}
KeyWhat it holds
namespaceThe query’s workspace, by its path from the content root.
documentThe query’s file, as {"path": ...} from the content root.
titleThe statement’s title in the scratch file.
chartThe chart as the page draws it. Its fields become the scratch file’s chart.

What it answers

The answer gives the scratch file’s path, the statement that holds the query, and its range. Run it with kater show, with the file in --select and --statement. The workspace’s fields and calculations stay in the workspace, so nothing is changed into fields of the shared model.

See also