# CustomizationRule

- [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#SCHEMA_REPRESENTATION)
- [BigQueryPartitioning](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#BigQueryPartitioning)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#BigQueryPartitioning.SCHEMA_REPRESENTATION)
- [IntegerRangePartition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#IntegerRangePartition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#IntegerRangePartition.SCHEMA_REPRESENTATION)
- [TimeUnitPartition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#TimeUnitPartition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#TimeUnitPartition.SCHEMA_REPRESENTATION)
- [PartitioningTimeGranularity](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#PartitioningTimeGranularity)
- [IngestionTimePartition](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#IngestionTimePartition)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#IngestionTimePartition.SCHEMA_REPRESENTATION)
- [BigQueryClustering](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#BigQueryClustering)
  - [JSON representation](https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#BigQueryClustering.SCHEMA_REPRESENTATION)

A customization rule to apply to a set of objects.

| JSON representation |
|---|
| ``` { // Union field `rule` can be only one of the following: "bigqueryPartitioning": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#BigQueryPartitioning`) }, "bigqueryClustering": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#BigQueryClustering`) } // End of list of possible types for union field `rule`. } ``` |

| Fields ||
|---|---|
| Union field `rule`. The rule to apply. `rule` can be only one of the following: ||
| `bigqueryPartitioning` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#BigQueryPartitioning`)`` BigQuery partitioning rule. |
| `bigqueryClustering` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#BigQueryClustering`)`` BigQuery clustering rule. |

## BigQueryPartitioning

BigQuery partitioning configuration.

| JSON representation |
|---|
| ``` { "requirePartitionFilter": boolean, // Union field `partitioning` can be only one of the following: "integerRangePartition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#IntegerRangePartition`) }, "timeUnitPartition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#TimeUnitPartition`) }, "ingestionTimePartition": { object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#IngestionTimePartition`) } // End of list of possible types for union field `partitioning`. } ``` |

| Fields ||
|---|---|
| `requirePartitionFilter` | `boolean` Optional. If true, queries over the table require a partition filter. |
| Union field `partitioning`. Partitioning to apply on the table. `partitioning` can be only one of the following: ||
| `integerRangePartition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#IntegerRangePartition`)`` Integer range partitioning. |
| `timeUnitPartition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#TimeUnitPartition`)`` Time unit column partitioning. |
| `ingestionTimePartition` | ``object (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#IngestionTimePartition`)`` Ingestion time partitioning. |

## IntegerRangePartition

Integer range partitioning. see <https://cloud.google.com/bigquery/docs/partitioned-tables#integer_range>

| JSON representation |
|---|
| ``` { "column": string, "start": string, "end": string, "interval": string } ``` |

| Fields ||
|---|---|
| `column` | `string` Required. The partitioning column. |
| `start` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The starting value for range partitioning (inclusive). |
| `end` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The ending value for range partitioning (exclusive). |
| `interval` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. The interval of each range within the partition. |

## TimeUnitPartition

Time unit column partitioning. see <https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables>

| JSON representation |
|---|
| ``` { "column": string, "partitioningTimeGranularity": enum (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#PartitioningTimeGranularity`) } ``` |

| Fields ||
|---|---|
| `column` | `string` Required. The partitioning column. |
| `partitioningTimeGranularity` | ``enum (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#PartitioningTimeGranularity`)`` Optional. Partition granularity. |

## PartitioningTimeGranularity

Partitioning granularity for time partitions.

| Enums ||
|---|---|
| `PARTITIONING_TIME_GRANULARITY_UNSPECIFIED` | Unspecified partitioing interval. |
| `PARTITIONING_TIME_GRANULARITY_HOUR` | Hourly partitioning. |
| `PARTITIONING_TIME_GRANULARITY_DAY` | Daily partitioning. |
| `PARTITIONING_TIME_GRANULARITY_MONTH` | Monthly partitioning. |
| `PARTITIONING_TIME_GRANULARITY_YEAR` | Yearly partitioning. |

## IngestionTimePartition

Ingestion time partitioning. see <https://cloud.google.com/bigquery/docs/partitioned-tables#ingestion_time>

| JSON representation |
|---|
| ``` { "partitioningTimeGranularity": enum (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#PartitioningTimeGranularity`) } ``` |

| Fields ||
|---|---|
| `partitioningTimeGranularity` | ``enum (`https://docs.cloud.google.com/datastream/docs/reference/rest/v1/CustomizationRule#PartitioningTimeGranularity`)`` Optional. Partition granularity |

## BigQueryClustering

BigQuery clustering configuration.

| JSON representation |
|---|
| ``` { "columns": [ string ] } ``` |

| Fields ||
|---|---|
| `columns[]` | `string` Required. Column names to set as clustering columns. |