Field Count Check Examples
Three real-world scenarios that show how the Field Count check behaves in production: a stable extract that passes, a dropped column, and an added column. Field Count is a Shape-only rule, so every failure is reported as a single Shape Anomaly for the container.
The situation: A partner receives a nightly ORDERS extract with an agreed layout of nine columns. The check exists to notice the moment that layout changes, in either direction.
Check configuration
| Field | Value |
|---|---|
| Rule | Field Count |
| Table / File | ORDERS |
| Number of Fields | 9 |
| Owner | (check creator) |
| Anomaly Assignee | (Integrations team) |
| Description | The ORDERS extract must hold exactly 9 fields. |
| Tags | schema, drift |
| Additional Metadata | jira: DATA-9501 |
| Status | Active |
Payload
{
"description": "The ORDERS extract must hold exactly 9 fields.",
"rule": "fieldCount",
"fields": [],
"container_id": 145,
"properties": {"value": 9},
"tags": ["schema", "drift"],
"additional_metadata": {"jira": "DATA-9501"},
"template_id": null,
"status": "Active",
"owner_id": 7,
"default_anomaly_assignee_id": 12
}
Sample Data
| Container | Fields present | Count |
|---|---|---|
ORDERS |
o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment | 9 |
What gets flagged
The container holds exactly nine fields, so the check passes and no anomaly is created. This is the baseline the next two scenarios drift away from.
No anomaly
The container holds 9 fields, matching the expected count. The check passes.
Flowchart
graph TD
A["Read the container's shape"] --> B["Count the fields: 9"]
B --> C{"Does 9 equal the<br/>expected 9?"}
C -->|Yes| D["Check passes"]
C -->|No| E["Report a Shape Anomaly"]
Equivalent SQL
The situation: An upstream release removed o_comment from the extract without telling the consumers. The row data still looks fine, so no value-level check fires: only the shape changed.
Check configuration
| Field | Value |
|---|---|
| Rule | Field Count |
| Table / File | ORDERS |
| Number of Fields | 9 |
| Owner | (check creator) |
| Anomaly Assignee | (Integrations team) |
| Description | The ORDERS extract must hold exactly 9 fields. |
| Tags | schema, drift |
| Additional Metadata | jira: DATA-9501 |
| Status | Active |
Payload
{
"description": "The ORDERS extract must hold exactly 9 fields.",
"rule": "fieldCount",
"fields": [],
"container_id": 145,
"properties": {"value": 9},
"tags": ["schema", "drift"],
"additional_metadata": {"jira": "DATA-9501"},
"template_id": null,
"status": "Active",
"owner_id": 7,
"default_anomaly_assignee_id": 12
}
Sample Data
| Container | Fields present | Count |
|---|---|---|
ORDERS |
o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority | 8 |
What gets flagged
The scan finds eight fields where nine are expected. The check reports a single Shape Anomaly for the container; the direction of the difference tells you a column was dropped rather than added.
Shape Anomaly
The container holds 8 fields, which does not match the expected count of 9.
Flowchart
graph TD
A["Read the container's shape"] --> B["Count the fields: 8"]
B --> C{"Does 8 equal the<br/>expected 9?"}
C -->|Yes| D["Check passes"]
C -->|No| E["Report a Shape Anomaly<br/>for the container"]
Equivalent SQL
The situation: A new o_channel column was added upstream. Nothing broke immediately, but the downstream loader maps columns by position and will silently shift every value on the next run.
Check configuration
| Field | Value |
|---|---|
| Rule | Field Count |
| Table / File | ORDERS |
| Number of Fields | 9 |
| Owner | (check creator) |
| Anomaly Assignee | (Integrations team) |
| Description | The ORDERS extract must hold exactly 9 fields. |
| Tags | schema, drift |
| Additional Metadata | jira: DATA-9501 |
| Status | Active |
Payload
{
"description": "The ORDERS extract must hold exactly 9 fields.",
"rule": "fieldCount",
"fields": [],
"container_id": 145,
"properties": {"value": 9},
"tags": ["schema", "drift"],
"additional_metadata": {"jira": "DATA-9501"},
"template_id": null,
"status": "Active",
"owner_id": 7,
"default_anomaly_assignee_id": 12
}
Sample Data
| Container | Fields present | Count |
|---|---|---|
ORDERS |
o_orderkey, o_custkey, o_orderstatus, o_totalprice, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment, o_channel | 10 |
What gets flagged
The scan finds ten fields where nine are expected, so the check reports a Shape Anomaly. If the addition is legitimate, the fix is to update the check's Number of Fields as part of accepting the new layout.
Shape Anomaly
The container holds 10 fields, which does not match the expected count of 9.
Flowchart
graph TD
A["Read the container's shape"] --> B["Count the fields: 10"]
B --> C{"Does 10 equal the<br/>expected 9?"}
C -->|Yes| D["Check passes"]
C -->|No| E["Report a Shape Anomaly<br/>for the container"]
Equivalent SQL
See Also
-
How It Works
The complete reference: definition, container scope, the expected count, how the shape is evaluated, and why coverage and filters do not apply.
-
Anomaly Reporting
What the Shape Anomaly reports, how to read it, and why per-row reporting does not apply.
-
Best Practices
Guidelines for pairing with Expected Schema, keeping the count current, and avoiding false alarms.
-
Permissions
The team permission each action needs: view, create, edit, archive, restore, and delete.