Export Sample Data

This page covers how to easily export sample data from common data sources to a CSV file. Instead of connecting your full data source to Rockset, you can upload this sample data instead.

Amazon DynamoDB

  1. Navigate to the DynamoDB Console in the AWS Management Console.

  2. Open the PartiQL Editor and enter the query you would like to run against your DynamoDB table.

  3. Under the Table view, choose "Download results to CSV".

    Amazon DynamoDB Export

Amazon S3

  1. Navigate to the Amazon S3 Console in the AWS Management Console.

  2. Select the S3 bucket and folder that contains your file.

  3. Select your file and click "Download".

    Amazon S3 Export

πŸ’‘

If you wish to to download multiple files at a time, use the AWS CLI.

MongoDB

  1. Install MongoDB Database Tools, which includes the mongoexport command-line tool.

  2. Run the following mongoexport command with the names of your MongoDB database, collection, and fields to export.

πŸ’‘

You can specify other options for the field names.

```
mongoexport --db=users --collection=contacts --type=csv --fields=name,address --out=/opt/backups/contacts.csv
```

MySQL

  1. Navigate to the mysql interactive terminal.

  2. Run the following command with the query you would like to run against your MySQL table.

πŸ’‘

You can specify additional options for the export.

```
SELECT orderNumber, status, orderDate
FROM orders
INTO OUTFILE '/var/lib/mysql-files/orders.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"', ESCAPED BY '\'
LINES TERMINATED BY '\n';
```

PostgreSQL

  1. Navigate to the psql interactive terminal.

  2. Run the following \copy command with the name of your PostgreSQL table or the query you
    would like to run against your table. No SQL superuser privileges are required.

πŸ’‘

You can specify additional options.

```
\copy persons_table to '/tmp/persons_client.csv' with csv
```

Snowflake

  1. Download and install
    SnowSQL, Snowflake’s command-line tool.

  2. Define a named connection to connect to Snowflake.

  3. Run the following SnowSQL command with the connection you created in step 2, the name of your Snowflake database, and the query you would like to run against your database.

πŸ’‘

You can specify additional options for the output.

#### Linux/MacOS

```
snowsql -c my_example_connection -d sales_db -s public -q 'select * from mytable limit 10' \
    -o output_format=csv -o header=false -o timing=false -o friendly=false  > output_file.csv
```
#### Windows

```
snowsql -c my_example_connection -d sales_db -s public -q "select * from mytable limit 10" \
    -o output_format=csv -o header=false -o timing=false -o friendly=false  > output_file.csv
```