Skip to main content
On this page

Kater CLI Present and share chart

kater chart preview

Draws a chart that is not saved from the rows a query run already kept.

It does not reach the warehouse, so use it to try a chart quickly. Give it the id of a snapshot from kater chart snapshot.

Examples

Terminal window
# Keep the spend_by_platform rows from its last run in a file
kater chart snapshot --request-file spend_by_platform.json --json > spend_by_platform_snapshot.json
# Keep the spend_mix chart in a file
kater chart read --request-file spend_mix.json --json > spend_mix_read.json
# Make a preview request from the chart and the snapshot's id
jq --slurp '{spec: .[0].definition.spec, sql: .[0].definition.sql, snapshot_id: .[1].snapshot.id}' spend_mix_read.json spend_by_platform_snapshot.json > spend_mix_preview.json
# Draw the chart from those rows
kater chart preview --request-file spend_mix_preview.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 and the snapshot to draw it from, 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.
snapshot_idThe id of the snapshot, from kater chart snapshot.
inputsOptional. The query’s parameter values and filters.
require_completeOptional, false when you leave it out. True refuses to draw from part of the rows, with chart_complete_required. Some chart kinds always need every row.

When it cannot draw

A preview draws only from kept rows. When a chart needs every row and the snapshot holds only some, run the chart with kater chart execute.

See also