> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Table

> Creates a new table in a specified BigQuery dataset

Creates a new table in a specified BigQuery dataset. Suppport manual and automatic schema detection. Auto is recommended for most use cases.

|                       |                         |
| --------------------- | ----------------------- |
| **App**               | BigQuery                |
| **Operation ID**      | `bigquery_create_table` |
| **Type**              | Action                  |
| **Connection**        | `bigquery` (required)   |
| **Credits per run**   | 1                       |
| **Agent / MCP tool**  | Yes                     |
| **Requires approval** | Yes (write operation)   |

## Inputs

| Field                 | Type                                                    | Required | Default | Description                                                                                                                                                                                                   |
| --------------------- | ------------------------------------------------------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project`             | string or SelectItem                                    | Yes      | -       | Select the Google BigQuery project, ask the user for it if not provided                                                                                                                                       |
| `dataset`             | string or SelectItem                                    | Yes      | -       | Select the BigQuery dataset to create the table in                                                                                                                                                            |
| `table_id`            | string                                                  | Yes      | -       | Table name (letters, numbers, underscore). Must not already exist unless 'Skip Error If Already There' is enabled.                                                                                            |
| `schema_mode`         | string or SelectableOption                              | Yes      | -       | Provide schema manually or auto-detect from data. Default is auto                                                                                                                                             |
| `schema_json`         | string                                                  | No       | -       | (Manual mode) JSON array of column definitions. Example: \[\{"name":"user\_id","type":"STRING","mode":"REQUIRED"}]                                                                                            |
| `sample_data`         | array of object (also accepts a comma-separated string) | No       | -       | (Auto mode) Sample rows (list of objects) for schema autodetection                                                                                                                                            |
| `exists_ok`           | boolean                                                 | No       | `False` | If true, reuse existing table if it already exists instead of erroring.                                                                                                                                       |
| `enable_partitioning` | boolean                                                 | No       | `False` | Enable time partitioning (use partition\_field & partition\_type).                                                                                                                                            |
| `partition_field`     | string                                                  | No       | -       | Optional column name to use for time partitioning (must be DATE or TIMESTAMP in schema/autodetected). If provided and table exists already, this operation does not modify the existing table's partitioning. |
| `partition_type`      | string or SelectableOption                              | No       | -       | Partition granularity (DAY, HOUR, MONTH, YEAR) when partition\_field is set.                                                                                                                                  |

### SelectItem

| Field   | Type   | Required | Default | Description                                                                                          |
| ------- | ------ | -------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `value` | string | Yes      | -       | The value of the selectable item.                                                                    |
| `label` | string | Yes      | -       | The label of the selectable item, used for display purposes. If not provided, defaults to the value. |

### SelectableOption

| Field   | Type   | Required | Default | Description |
| ------- | ------ | -------- | ------- | ----------- |
| `value` | string | Yes      | -       |             |
| `label` | string | Yes      | -       |             |

## Output

**Type**: `Dict`

Returns created table details.

**Fields**: `table_id`, `full_table_id`, `project_id`, `dataset_id`, `num_rows`, `rows_loaded`, `enable_partitioning`
