I am new python and stuck with an issue which as stated below,please pardon my ignorance
Problem statement:- Python3 dataframe holds values(approx 1 million rows and have few thousand columns) which needed to saved in redshift database
Solutions looked into :-
1> As per documentation the quickest method to perform such operation is using copy
command. But in my case the table structure keeps on changing .So this solution is not correct fit for me
2> Tried to save dataframe directly using to_sql
but it takes forever to complete it .Have tried same using chunksize ,But that also didn't worked(it takes forever to complete .I had left the script for 2-3 hrs but still it was running)
df.to_sql('a_265', conn, index = False, if_exists = 'replace')
df.to_sql('a_265', conn, index = False, if_exists = 'replace', chunksize=10)
3> Tried to look into another option available odo
.But this also needs to have a table structure present.Since this also uses copy command in backgroud
So are there any solutions available which will enable me to achieve bulk upload of csv into redshift
*Note :- Table structure keeps on changing .Hence if suggesting copy command please update me also how to handle changes in table structure