> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/quickstarts-1/jobs/transformation/data-targets/output-to-amazon-s3.md).

# Output to Amazon S3

## Prerequisites

Ensure that you have an [Amazon S3](/content/reference-1/sql-commands/connections/create-connection/amazon-s3.md) connection with the correct permissions to write to your target bucket.&#x20;

## Create a job writing into Amazon S3

After you have fulfilled the prerequisites, you can create an [`INSERT`](broken://spaces/WKMq8oT1OPM3KjP8vlg2/pages/cIsNxxw9uqWThAPGEDDW) job as follows:

```sql
CREATE SYNC JOB insert_into_s3
    START_FROM = BEGINNING
    FILE_FORMAT = (type = CSV)
    COMPRESSION = GZIP
    DATE_PATTERN = 'yyyy-MM-dd-HH-mm'
    RUN_INTERVAL = 1 MINUTE
    COMPUTE_CLUSTER = "Default Compute"
AS INSERT INTO S3 s3_output_connection 
    LOCATION = 's3://your-bucket-name/path/to/folder/'
    -- Use the SELECT statement to choose columns from the source and 
    --implement your business logic transformations.
    SELECT 
      column1 AS s3_column1, 
      MD5(column2) AS s3_column2 -- hash or mask columns using built-in functions
    FROM default_glue_catalog.your_schema.your_raw_data_table
    WHERE time_filter();
```

This example only demonstrates an example of all job options available when writing to Amazon S3. Depending on your use case, you may want to configure a different set of options. For example, set the `FILE_FORMAT` to Parquet or the `COMPRESSION` to SNAPPY

## Alter a job writing to Amazon S3

Certain job options are considered mutable, meaning that in some cases, you can run a SQL command to alter an existing transformation job rather than having to create a new one.

For example, take the job we created as an example earlier:

```sql
CREATE SYNC JOB insert_into_s3
    START_FROM = BEGINNING
    FILE_FORMAT = (type = CSV)
    COMPRESSION = GZIP
    DATE_PATTERN = 'yyyy-MM-dd-HH-mm'
    RUN_INTERVAL = 1 MINUTE
    COMPUTE_CLUSTER = "Default Compute"
AS INSERT INTO S3 s3_output_connection 
    LOCATION = 's3://your-bucket-name/path/to/folder/'
    -- Use the SELECT statement to choose columns from the source and 
    -- implement your business logic transformations.
    SELECT 
      column1 AS s3_column1, 
      MD5(column2) AS s3_column2 -- hash or mask columns using built-in functions
    FROM default_glue_catalog.your_schema.your_raw_data_table
    WHERE time_filter();
```

If you wanted to keep the job as is but just change the cluster that is running the job, you can run the following command:

```sql
ALTER JOB insert_into_s3
    SET COMPUTE_CLUSTER = high_memory_cluster;
```

Note that some options such as `RUN_INTERVAL` or the `FILE_FORMAT` cannot be altered once the connection has been created.

## Drop a job writing to Amazon S3

If you no longer need a certain job, you can easily drop it with the following SQL command:

```sql
DROP JOB insert_into_s3;
```

***

{% hint style="success" %}
**Learn More**&#x20;

For the full list of job options with syntax and detailed descriptions, see the transformation job options for [Amazon S3](/content/reference-1/sql-commands/jobs/create-job/ingestion/amazon-s3.md).

See the [INSERT](/content/reference-1/sql-commands/jobs/create-job/transformation/insert.md) SQL command reference for more details and examples.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/quickstarts-1/jobs/transformation/data-targets/output-to-amazon-s3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
