I’m trying to copy data from S3 to Redshift using dbt core. But simple copy command is not working.
Can somebody please suggest, how to copy data from S3 to Redshift using dbt core.
This is the sample code that I was using:
COPY <table_name>
FROM ‘s3://<bucket_name>/<path_to_file>’
CREDENTIALS ‘aws_access_key_id=<access_key>;aws_secret_access_key=<secret_key>’
REGION ‘’
FORMAT AS <file_format>;
What error messages do you see? Have you tried running that same command in a query runner (DataGrip etc)? Commands issued through dbt are the same as if they’re done through any other sql interface, so I think the problems you’re running into will be with the format of your copy command. I’m not super familiar with the syntax though unfortunately
Hi, Thanks for you reply.
This command is working in SQL workbench etc.
Is there any other way to copy data from S3 to Redshift using dbt core. I’m using dbt core in VS code.
What errors are you seeing? Have you had a look at the logs file to see what command is being sent to the server?