How do I load CSV file into Amazon Redshift from OS Windows using Python? -
i need load csv files desktop (windows) redshift tables.
can demonstrate implementing process in python?
i assuming script accept csv file name , connection details.
the result of execution of script csv data appended redshift table.
start uploading file s3 effective way load data redshift copy s3.
you can use aws sdk s3: https://boto3.readthedocs.io/en/latest/reference/services/s3.html#s3.object.put
the next step run copy command. done through sql connection. here have few options, using standard jdbc/odbc connection redshift/postgresql (pyodbc - https://github.com/mkleehammer/pyodbc, example), or dedicated library such copy (http://initd.org/psycopg/, example). copy command point s3 object uploaded in step 1.
Comments
Post a Comment