Skip to main content
On this page

Kater CLI Present and share chart

kater chart execute

Runs a chart on the warehouse and answers with its rows and its drawing, as a dashboard tile does.

You give the chart’s spec with its SQL or its plan, so it runs a saved chart or one you changed. From the terminal, each call runs the chart on the warehouse.

Examples

Terminal window
# Keep the spend_mix chart in a file
kater chart read --request-file spend_mix.json --json > spend_mix_read.json
# Make a request that runs the chart as its dashboard tile does, with a small answer
jq '{spec: .definition.spec, sql: .definition.sql, own_filters: true, include_runtime: false}' spend_mix_read.json > spend_mix_execute.json
# Run the chart on the warehouse
kater chart execute --request-file spend_mix_execute.json

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 chart to run, as JSON. Give - to read it from standard input. See The request.

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

The request

FieldWhat it holds
specThe chart, as the spec of kater chart read holds it.
sqlThe SQL that selects the query’s columns for the chart. Give sql or plan, not both.
planThe same selection in parts, as kater chart plan takes it.
inputsOptional. The query’s parameter values and filters. Without them, the chart’s saved inputs apply.
own_filtersOptional. True turns on the query’s own optional filters, as a dashboard tile does. A filter whose parameter has no value stays off.
include_runtimeOptional, true when you leave it out. The run’s contract, which explains each field, is most of the answer and is often over a megabyte. False leaves it out.
freshOptional. True runs the query again before Kater draws the chart. From the terminal, each call runs on the warehouse anyway.
first_rowsOptional. The most rows the answer carries, from 1 to 10000, where Kater keeps the rest. From the terminal, Kater keeps no result, so every row comes.

What it shows

The answer holds the rows and the drawing in snapshot, the chart in definition, and the query’s file in query_document. refreshing is true when the rows are old and are being read again. Rows are old after 15 minutes, unless kater.config.yaml sets another time.

Too many rows

When the chart’s rows are too large for one answer, Kater refuses with chart_output_budget. Give the chart a row limit, as limit in its plan or LIMIT in its SQL, and try again.

See also