Updating snowflake table row by row using panda dataframe (iterrows()) taking lot of time .Can some one give better approach to speed up updates?
Solution to this is:
Insert the data into some transient table and then then use that table for update.
For insert :
data = panda.DataFrame(result)
just use data.to_csv('file complete path',index=False,Header=True)
using put command place the file in internal stage and from there use Copy command to copy data into transient table.
later on you can use this table to update your target table.
ctx=con.cursor()
ctx.execute(select col1 from table1)
result=ctx.fetchall()
data=pd.DataFrame(result)
data.columns['field']
for index,row in data:
update table2 set col2='some value' where col1=str(row['field'])