Guide The jobs it is for
“It has to be right before anyone sees it”
What you are trying to do#
Before the report goes out you eyeball the totals and hope. You want the pipeline to check its own result every time it runs, compare it with last time, and stop before anything is written when something is wrong.
Steps#
- Start from what the app proposes. Select a step in the recipe and look under Checks: the app proposes checks from what it has seen in the data, such as “Order ID has no duplicates in 18,734,112 rows. Add a check that it stays unique?”. Add check adds it in one click. Propose checks for this step in the command palette asks again.
- Add your own. Choose Add check under Checks (or right-click a column header and choose Add a check on this column, then the kind). Pick a kind; each is a rule in plain words:
- Never empty, Every day has rows, Unique: “Order ID is unique”.
- Between two values, One of a list, Matches a pattern, Length, A condition holds: “End date is not before Start date”.
- Exists in another table, Every row finds a match.
- Row count, Row count compared with the last run: “Row count is within 20% of the last run”.
- A total: “Sum of Amount equals the control total in the source file”.
- The source file is fresh, The latest date is recent, Rows rejected, The columns are as expected, No two input files are identical, A column compared with the last run.
- Custom SQL: a query that must return no rows. From a plugin: a check an installed plugin provides.
- Choose what a failure does. When it fails: Stop the run, or Warn. A warning lets the run continue and is flagged in the report; a check that stops the run stops it before any output is written. Allow lets a few failing rows through before the check trips, as a count or a share. Only check some rows… limits it to rows that meet a condition.
- Or deliver what passes. For a row-level check, Hold back the failing rows and deliver the rest puts the failing rows in the run’s quarantine and delivers the others; the run ends with warnings, and the held rows wait to be released (Decide on rows waiting in quarantine in the command palette).
- Check now. The editor shows the Result on the current data as you type. Check the data now runs every check of the pipeline without writing anything; so does
gridkiln checkon the command line. - Rehearse the whole run. Run options › Dry run does everything except deliver: files go to a sandbox folder and messages go only to you. Show what the last dry run would do opens its result.
What you will see#
- In the recipe, checks appear under the step they are attached to, and as badges on the step card (“3 checks”, “1 warning”, “1 failed”).
- Each check is one line: its state, the rule, its severity (“stops the run” or “warns”) and the result. A failed check shows the offending rows, not only a count: show rows opens the grid at that step, filtered to them.
- The run record puts each check beside the last run, and Compared with earlier runs shows the rows read and written against the last run.
- Rows in the drawer (⇧⌥W / Shift+Alt+W) is the row accounting: a waterfall from the rows read to the rows written, with the reason rows left at each step (filtered, de-duplicated, unmatched, rejected). Choose a measure such as Amount to follow a total through the steps instead.
When it goes wrong#
| You see | What it means and what to do |
|---|---|
| “Daily orders stopped. Check failed: Order ID is unique, 37 duplicates. Nothing was written.” | The check did its job: nothing was written or sent. Open the run at the failing step to see the 37 rows; see Walkthrough 4 |
| “There is no earlier run to compare with yet” | Checks that compare with the last run start after the pipeline’s first full run. The editor says what the check does until then |
| A check keeps warning | It shows under Needs attention on Home and in the Runs view. Fix the data, or change the check if the rule is wrong |
| A check trips on a few expected rows | Use Allow to let that many through, or Only check some rows… |
See also#
- Checks for every kind and option.
- Run on a schedule and hear when it fails.