---
updatedAt: 2026-06-25T22:42:04.000Z
agentTools:
  projectIndex: https://docs.getmontecarlo.com/llms.txt
---

# Partition filtering for monitors

When Monte Carlo writes monitor queries to execute on your warehouse or lake, it uses the time-based partitions that are known based on metadata collection. Users do not need to specify partitions when creating most monitors, as they will be automatically inferred.

## Usage

For Metric monitors with automatic thresholds, the time-based partition will similarly be automatically detected, though it is not exposed to the user in any way.

## Integrations Supported

* [BigQuery](https://docs.getmontecarlo.com/docs/bigquery)
* [Databricks](https://docs.getmontecarlo.com/docs/overview-databricks)
* [Hive](https://docs.getmontecarlo.com/docs/hive-mysql) and [Glue](https://docs.getmontecarlo.com/docs/glue) Data Lakes

## Types of Queries Supported

Monte Carlo automatically detects and filters for date partitions for tables when writing queries for the following functionality:

* Monitors with automated thresholds
* Root Cause Analysis Queries

For monitors where Monte Carlo does not write the SQL automatically (like [Custom Monitors - SQL Rules](https://docs.getmontecarlo.com/docs/creating-sql-rules)), this feature is not supported. It is available for Field Metrics (with automated thresholds) and Dimension Tracking Monitors. Monitors that use **All Records** instead of **Recent Data** are not supported.

## Formats of Partitions Supported

Partitions must be stored in one of the following formats in order to be inferred by Monte Carlo:

### Single-Field Partitions

* Timestamp Fields: any native timestamp field in the listed supported integrations
* Date or String Fields - in the following formats (based on [standard C formatting](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes)):
  * `%Y-%m-%d`
  * `%Y-%m-%d`
  * `%Y-%m-%d-%H`
  * `%Y-%m`
  * `%Y%m`
  * `%Y%m%d`
  * `%Y%m%d%H`
  * `'%Y%m%d%H%M%S`
  * `%Y%m%d%H%M%S`
  * `%Y%m%d%H%M%S000`
  * `%YW%W`

### Multiple-Field Partitions

If your partitions are separated into multiple String or Numeric fields, they must meet both the naming convention and formats below.

#### Field Naming Convention

* Year: `year`, `yr`, `y`
* Month: `month`, `m`
* Week: `??`
* Day: `day`, `d`
* Hour (optional): `hour`, `hr`, `h`

#### Field Supported Formats:

* Year: `%Y`
* Month: `%m`
* Week: `%W`
* Day: `%d`
* Hour: `%H`

## Supported Examples

* BigQuery table partition of `_PARTITIONTIME` or `_PARTITIONDATE`
* Databricks table partitioned by `dt` field in `%Y-%m-%d` format AND `hr` field in `%H` format