On this page
Kater CLI Make and compare new
kater new kater-dataset
Makes a Kater dataset file to a connection's shared layer.
Start it over one warehouse table, from your SQL, or as a custom SQL dataset. A create needs --target-path and --name, and --dry-run shows the file first. A Kater dataset gives each column of a table a field name and a label, and holds its first measures. See Kater datasets.
Examples
# Go to a connection's shared layer in your local copy of Kater contentcd connections/snowflake_prod_connection/modeling# Add a Kater dataset over a table that has a DB datasetkater new kater-dataset --target-path kater_objects/datasets --name facebook_ads__region_report --table DEMO_DB.ANALYTICS_AD_REPORTING.FACEBOOK_ADS__REGION_REPORT# Add a custom SQL dataset from the SQL in a filekater new kater-dataset --target-path kater_objects/datasets/marts --name ad_reporting__region_spend --sql-file ~/region_spend.sql --custom-sql# See the name and file it would write for a table, and write nothingkater new kater-dataset --target-path kater_objects/datasets --table DEMO_DB.ANALYTICS_AD_REPORTING.FACEBOOK_ADS__REGION_REPORT --dry-runOptions
It also takes the global options --json, --kater-root, --scope and --help.
Three ways to start
- Over a table.
--tablewrites a standard dataset that reads every column of the table as a dimension. The table needs a DB dataset first. Kater refuses a table that a standard Kater dataset already reads, and names that dataset. - From your SQL.
--sql-filegives the SQL. A standard dataset reads one DB dataset’s table, by itsDATABASE.SCHEMA.TABLEaddress. - Custom SQL.
--custom-sqlmakes a custom SQL dataset. Without--sql-file, it starts from a short query with one dimension and one measure, which you replace. - Empty. With none of these, the file holds only its frontmatter, and you write its SQL.
Kater checks the SQL before it writes. When the SQL has an error, Kater writes nothing and lists the problems.
After it saves
- Columns of a custom SQL dataset. Kater reads the dataset’s columns from the warehouse. When that read fails, the file stays saved, and the answer asks you to refresh the dataset.
- Sync and your dataset. Sync did not make this dataset. When it reads a table,
kater sync --resource-type kater_datasetstops at that table until you adopt the dataset with--adopt. Sync leaves a custom SQL dataset alone. - The answer. It gives the new file’s path,
authored_path, and the model’s id,object_id.
Names and access
- A new name. The name must be new among the connection’s Kater datasets. Kater never adds a number to make a name new.
- The naming rule. A name starts with a letter or
_, and holds letters, digits,_,$and-, up to 128 characters. - Edit access. You need edit access to the connection’s
modeling/folder. - In a local copy. The file is on your computer only. Commit it and run
kater git pushto publish it.
See Create commands.