Closed alwem82 closed 2 years ago
Hi @alwem82, I want to first clarify something which is that the row level upserts are currently not supported for Glue governed tables. My understanding is that they are on the Glue roadmap but not yet available. So you won't be able to use the merge_upsert_table
method on a governed table.
That being said, the above error is more generic. It's triggered by this method which checks if there are any discrepancies between the delta df and the one you are attempting to upsert into. So one way to check the issue is if you could compare the two dataframes to understand what caused the method to raise the error
P.S. Don't attach files. Please, prefer add code snippets directly in the message body. when trying to do upsert to governed table, i got below error. combination of two keys(registration_dttm and id) are unique. could anyone give the light on this issue?
Code delta_df = wr.lakeformation.read_sql_query( sql=f"SELECT * FROM {'governed_demo_table'};", database='governed_demo') delta_df.loc[delta_df['salary']>100000,'segment']='firstclass' delta_df.loc[delta_df['salary']<=100000,'segment']='secondclass' wr.s3.merge_upsert_table( delta_df=delta_df, database='governed_demo', table='governed_demo_table', primary_key=['registration_dttm','id'] )
ERROR MSG
FailedQualityCheck Traceback (most recent call last)