Description Usage Arguments Value Note Author(s) Examples
Unloads a redshift query to the AWS S3 cloud
1 2 3 4 5 6 7 8 9 |
conn |
The database connection |
query |
The Query to be unloaded |
filename |
The destination file path and name |
aws.accesskey |
The AWS Access Key. Defaults to ” but see note. |
aws.secretkey |
The AWS Secret Key. Defaults to ” but see note. |
delim |
The Delimiter to be used. Defaults to ',' |
allowOverwrite |
Logical. Allow Redshift to overwrite existing files with same name? Defaults to TRUE. |
parallel |
Logical. Allow Redshift to run parallelqueries and create multiple files? Defaults to TRUE. |
zip |
Logical. Allow Redshift to dump a zipped file? Defaults to TRUE. |
addquotes |
Logical. Wrap quotations marks around wach field. Defaults to TRUE. |
aws.role |
The AWS Role. Defaults to ” but see note. |
NA
Specify either
aws.access
and aws.secret
OR
aws.role
Role-based access is recommended – see http://docs.aws.amazon.com/redshift/latest/dg/copy-usage_notes-access-permissions.html#copy-usage_notes-access-role-based
Eeshan Chatterjee
1 2 3 4 | require(redshift)
# conn <- redshift.connect("jdbc:postgresql://blah.blah.eu-west-1.redshift.amazonaws.com:5439/data", "username", "password")
#redshift.unload(conn,query = "SELECT * from mytable where name like 'Eeshan'",filename = "s3://Eeshan/files/test.txt",aws.accesskey = <AWS Access Key>,aws.secretkey = <AWS Secret Key>,delim = ",",parallel = F)
#redshift.unload(conn,query = "SELECT * from mytable where name like 'Richard'",filename = "s3://Richard/files/test.txt",aws.role = <AWS Role>,delim = ",",parallel = F)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.