# Min Partition Size Check Examples

Source: https://userguide.qualytics.io/data-quality-checks/min-partition-size/deep-dive/examples/

Three real-world scenarios that show how the Min Partition Size check is typically used in production. All three report a Shape Anomaly, because the rule evaluates a partition's record count rather than individual rows.

**Tab: Truncated Daily Load**

**The situation:** Order lines land in one daily partition of roughly 300,000 records. A partition far below that means the upstream export was cut short, and every downstream total for that day will be understated. A floor of 100,000 catches a truncated load without firing on a genuinely quiet day.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | Min Partition Size |
| Table / File | `order_lines` |
| Minimum partition size | `100000` |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Ingestion team)* |
| Description | Every daily partition must load at least 100,000 records. |
| Tags | `load-monitoring`, `ingestion` |
| Additional Metadata | `jira: DATA-10305` |
| Status | Active |

**Payload**

```json
{
    "description": "Every daily partition must load at least 100,000 records.",
    "rule": "minPartitionSize",
    "fields": null,
    "container_id": 145,
    "properties": {
        "value": 100000
    },
    "tags": ["load-monitoring", "ingestion"],
    "additional_metadata": {"jira": "DATA-10305"},
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 12
}
```

**Sample Data** (the partitions this Scan loaded)

| Partition loaded | Records |
| --- | --- |
| dt=2026-03-09 | 298,410 |
| dt=2026-03-10 | 311,205 |
| dt=2026-03-11 | 42,760 |

**What gets flagged**

The 11 March partition holds 42,760 records against a normal 300,000: the export was interrupted partway through. The two earlier partitions pass. Only the failing partition produces an anomaly. The message names the table and both counts, and the anomaly's **Partition** attribute names `dt=2026-03-11`.

> **Example: Shape Anomaly**
>
> order_lines holds 42,760 records, fewer than the required 100,000

**Flowchart**

```mermaid
graph TD
    A["Scan loads a partition"] --> B["Count the records loaded"]
    B --> C{"Is the count at or above 100,000?"}
    C -->|Yes| D["Partition passes"]
    C -->|No| E["Shape Anomaly naming<br/>the partition and both counts"]
    D --> F["Next partition"]
    E --> F
```

**Equivalent SQL**

```sql
-- The partitions the check would flag.
SELECT dt AS partition_name,
       count(*) AS records
FROM order_lines
GROUP BY dt
HAVING count(*) < 100000;
```

**Tab: Short File in a Delivery**

**The situation:** A partner drops one CSV per store into a folder every night. Every store trades daily, so a file with almost nothing in it means the export failed for that store rather than that the store was closed. A floor of 500 rows separates a failed export from a slow night.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | Min Partition Size |
| Table / File | `store_transactions/` *(folder container)* |
| Minimum partition size | `500` |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Partner Data team)* |
| Description | Every store file must contain at least 500 transactions. |
| Tags | `partner-feed`, `load-monitoring` |
| Additional Metadata | `jira: DATA-10318` |
| Status | Active |

**Payload**

```json
{
    "description": "Every store file must contain at least 500 transactions.",
    "rule": "minPartitionSize",
    "fields": null,
    "container_id": 512,
    "properties": {
        "value": 500
    },
    "tags": ["partner-feed", "load-monitoring"],
    "additional_metadata": {"jira": "DATA-10318"},
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 47
}
```

**Sample Data** (each file in the folder is one partition)

| Partition loaded | Records |
| --- | --- |
| store_0142.csv | 4,180 |
| store_0143.csv | 3,905 |
| store_0144.csv | 12 |

**What gets flagged**

`store_0144.csv` arrived with 12 rows, so the partner's export for that store failed after writing the header and a handful of records. Because each file is its own partition, the two healthy files pass and only the short one is reported.

> **Example: Shape Anomaly**
>
> store_transactions holds 12 records, fewer than the required 500

**Flowchart**

```mermaid
graph TD
    A["Scan loads a partition"] --> B["Count the records loaded"]
    B --> C{"Is the count at or above 500?"}
    C -->|Yes| D["Partition passes"]
    C -->|No| E["Shape Anomaly naming<br/>the partition and both counts"]
    D --> F["Next partition"]
    E --> F
```

**Equivalent SQL**

```sql
-- The files the check would flag, if the folder were queried as one table
-- with a column identifying the source file.
SELECT source_file AS partition_name,
       count(*) AS records
FROM store_transactions
GROUP BY source_file
HAVING count(*) < 500;
```

**Tab: Reference Table That Must Stay Populated**

**The situation:** A product catalog is rebuilt from scratch on every load: the table is replaced rather than appended to. A rebuild that produces almost nothing silently empties the catalog and every join against it starts returning nothing. A floor of 5,000 records makes an empty rebuild visible before it reaches the reports.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | Min Partition Size |
| Table / File | `product_catalog` |
| Minimum partition size | `5000` |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Reference Data team)* |
| Description | The product catalog must never be rebuilt with fewer than 5,000 products. |
| Tags | `reference-data`, `load-monitoring` |
| Additional Metadata | `jira: DATA-10339` |
| Status | Active |

**Payload**

```json
{
    "description": "The product catalog must never be rebuilt with fewer than 5,000 products.",
    "rule": "minPartitionSize",
    "fields": null,
    "container_id": 733,
    "properties": {
        "value": 5000
    },
    "tags": ["reference-data", "load-monitoring"],
    "additional_metadata": {"jira": "DATA-10339"},
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 41
}
```

**Sample Data** (a Full scan loads the whole table as one partition)

| Partition loaded | Records |
| --- | --- |
| *(full rebuild)* | 0 |

**What gets flagged**

The rebuild produced an empty table: the upstream source was unavailable and the job wrote nothing rather than failing. Without this check the emptiness would only surface when downstream joins started returning no rows. The Scan loaded the whole table as one partition, so a single anomaly is raised for it.

> **Example: Shape Anomaly**
>
> product_catalog holds 0 records, fewer than the required 5,000

**Flowchart**

```mermaid
graph TD
    A["Scan loads a partition"] --> B["Count the records loaded"]
    B --> C{"Is the count at or above 5,000?"}
    C -->|Yes| D["Partition passes"]
    C -->|No| E["Shape Anomaly naming<br/>the partition and both counts"]
    D --> F["Next partition"]
    E --> F
```

**Equivalent SQL**

```sql
-- The check would flag the rebuild when this returns a row.
SELECT count(*) AS records
FROM product_catalog
HAVING count(*) < 5000;
```

## See Also

- **Best Practices**

  Guidelines for choosing a threshold, sizing it against real loads, and pairing the rule with its counterpart.

  [Best Practices](https://userguide.qualytics.io/data-quality-checks/min-partition-size/deep-dive/best-practices/)
- **Permissions**

  The team permission each action needs: view, create, edit, archive, restore, and delete.

  [Permissions](https://userguide.qualytics.io/data-quality-checks/min-partition-size/deep-dive/permissions/)
- **How It Works**

  The complete reference: definition, what a partition is, the minimum partition size property, and why the rule takes no field, filter, or coverage.

  [How It Works](https://userguide.qualytics.io/data-quality-checks/min-partition-size/deep-dive/how-it-works/)
- **Anomaly Reporting**

  The Shape Anomaly the check produces, what the numbers mean, and how partition-level anomalies differ from row-level ones.

  [Anomaly Reporting](https://userguide.qualytics.io/data-quality-checks/min-partition-size/deep-dive/anomaly-reporting/)

*Last updated: September 22, 2026.*
