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
-
Navigate to the DynamoDB Console in the AWS Management Console.
-
Open the PartiQL Editor and enter the query you would like to run against your DynamoDB table.
-
Under the Table view, choose Download results to CSV.
Amazon S3
-
Navigate to the Amazon S3 Console in the AWS Management Console.
-
Select the S3 bucket and folder that contains your file.
-
Select your file and click Download.
Note: If you wish to to download multiple files at a time, use
the AWS CLI.
MongoDB
-
Install
MongoDB Database Tools, which includes themongoexport
command-line tool. -
Run the following
mongoexport
command with the names of your MongoDB database, collection,
and fields to export.**Note:** 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
-
Navigate to the mysql interactive terminal.
-
Run the following command with the query you would like to run against your MySQL table.
**Note:** 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
-
Navigate to the psql interactive terminal.
-
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.**Note:** You can specify
``` \copy persons_table to '/tmp/persons_client.csv' with csv ```
Snowflake
-
Download and install
SnowSQL, Snowflake’s command-line tool. -
Define a
named connection to connect to Snowflake. -
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.**Note:** 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 ```
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 ```
Updated 1 day ago