# Table Export

Export table data from the database to external storage.

---

## Overview

The Table Export feature enables you to export data from your organization's Suger database tables to various external storage destinations in multiple file formats. Whether you need a one-time export or recurring scheduled exports, this feature provides flexible options to meet your data extraction needs.

## Creating an Export Task

1. Navigate to **Settings** > **Table Export** tab
2. Click `New Task`
3. Configure the following settings:
   - **Name** *(optional)*: A descriptive name for your export task
   - **Source Table** *(required)*: Select the table to export
   - **Destination** *(required)*: Choose where to export the data: **Download** (the default), **Snowflake**, **Google BigQuery**, **Google Storage**, or **Databricks**. The **Auto-Shared Referral Report** can only be downloaded, and the **PRACR Report** can't be sent to Google BigQuery or Databricks.
   - **Format** *(required)*: Select CSV, JSON, or PARQUET (defaults to CSV). Not offered where Suger sets the format: CSV for Snowflake and for the two reports above, Parquet for Google BigQuery and Databricks.
   - **Times** *(required)*: Choose between one-time or scheduled export
- For scheduled tasks: Configure the export interval
   - **Time Range** *(optional)*: Filter data by date range (defaults to last 30 days)

> <img src="/img/table-export.jpg" alt="New Table Export task configuration form" style="max-width:617px;width:100%;display:inline;margin:0 auto;box-shadow: 5px 5px 5px #eee" />

## Limits

**An organization may create at most 30 export tasks in any trailing 30 days.** At the cap, **Create** shows an error that gives how many tasks your organization created in the last 30 days, the maximum, and that each task frees its slot 30 days after it was created. The drawer stays open, so your settings aren't lost. Through the API, the request returns `429`.

Two things this cap is *not*:

- **It is not a ceiling on how many tasks may run.** Existing tasks keep running on their schedules. The cap counts task rows created inside the trailing window, so it limits how fast tasks are created, not how many exist.
- **It is not fixed by deleting old tasks.** A task older than 30 days was never counted, so deleting it frees nothing — and deleting one inside the window also tears down its schedule. A slot frees itself **30 days after that task was created**.

The allowance is shared with private-offer dimension-sync tasks. It is sized to let an organization provision an export for every exportable table in one go and still leave headroom.

## Export Types

### One-time Export
- Executes immediately after creation
- Ideal for ad-hoc data exports
- Export status can be monitored in the task list

### Scheduled Export
- Runs automatically based on configured schedule
- Supports recurring exports at regular intervals
- Can be manually triggered or cancelled as needed

## Export Formats

### CSV
- **Format**: Comma-separated values
- **Use Case**: Ideal for spreadsheet applications and data analysis
- **Features**:
  - Includes header row with column names
  - Standard UTF-8 encoding
  - Easy to import into Excel or Google Sheets

### JSON
- **Format**: JavaScript Object Notation
- **Use Case**: Perfect for data processing and system integration
- **Features**:
  - Maintains data types and structure
  - Human-readable format
  - Widely supported by programming languages and tools

### PARQUET
- **Format**: Columnar storage format
- **Use Case**: Optimized for big data analytics
- **Features**:
  - Efficient compression
  - Fast query performance
  - Preserves schema information

## Time-based Filtering

Filter your export data by selecting one of these predefined ranges:

| Time Range | Description |
|------------|-------------|
| Last 30 days | Data from the past month |
| Last 3 months | Previous quarter data |
| Last 6 months | Half-year of data |
| Last 1 year | Full year of data |
| Last 2 years | Two years of historical data |
| All | Complete dataset without time restriction |

## Export Destinations

Each run writes the selected data to one destination:

```d2
direction: right
source: "Source table\nin Suger"
run: "Export run\n(one-time or scheduled)"
download: "Download\na file link"
snowflake: "Snowflake\ntable dropped and recreated"
bigquery: "Google BigQuery\ntable replaced in one load job"
storage: "Google Storage\na new file in your bucket"
databricks: "Databricks\ntable dropped and recreated"
source -> run
run -> download
run -> snowflake
run -> bigquery
run -> storage
run -> databricks
```

### Direct Download
- Exports to Suger's secure AWS S3 bucket
- Provides a downloadable URL for accessing the exported file
- Secure and temporary access links

### Snowflake Integration

> **Important**: Prerequisites
>
> You must have Snowflake Integration configured before using this destination. See [Snowflake Integration](/integrations/snowflake/) for setup instructions.

#### Configuration Steps:
1. Select Warehouse
2. Select Database
3. Select Schema

> **Note**: A new table will be created automatically to store the exported data. If a table with the same name exists, it will be dropped and recreated.

### Google BigQuery

> **Important**: Prerequisites
>
> You must have the [BigQuery integration](/integrations/bigquery/) configured before using this destination.

Select the **Dataset ID** to export into.

- Suger loads the export into a table named after the source table, and creates that table if it doesn't exist.
- Each later run replaces the table's rows and schema in a single load job. If a run fails, the table keeps the previous export.
- Date columns are loaded as `DATE`.

### Databricks

> **Important**: Prerequisites
>
> You must have the [Databricks integration](/integrations/databricks/) configured before using this destination.

Select the **Catalog** and **Schema** to export into.

- Suger writes to a table named after the source table. Each run drops that table if it exists, recreates it, and loads the rows.
- Date columns are loaded as `DATE`.


### Task management
### Viewing Tasks
- Access all export tasks from the Table Export dashboard
- Filter tasks by status (Active, Running, Failed, etc.)

### Managing Scheduled Tasks
You can perform these actions on scheduled tasks:

1. **Start**
   - Manually trigger an immediate export
   - Useful for testing or urgent data needs

2. **Cancel**
   - Disable the scheduled task
   - Prevents future automatic executions
   - Cannot be re-enabled
