I am trying to copy some files from S3 to Redshift using copy command. I used following command through SQL workbench and it worked fine, it copied the data to Redshift Table.
copy <Redshift table name>
from 's3://my-bucket/path/to/directory/part'
iam_role 'arn:aws:iam::<IAM ROLE>'
delimiter '|' dateformat 'auto' IGNOREHEADER AS 1;
but when I copied the same command into .sql
file and tried to execute this SQL file using AWS data pipeline, pipeline just fails without giving any explicit error.
Due to some issues with internally developed pipeline definition generation tool, I am not able to use CopyToRedshift
type activity.
I would like to know how do I execute this copy command from an file?