Skip to content

Commit 81679eb

Browse files
committed
fix target has dup
1 parent 1bb05a5 commit 81679eb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pyiceberg/table/upsert_util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ def get_rows_to_update(source_table: pa.Table, target_table: pa.Table, join_cols
6262
"""
6363
all_columns = set(source_table.column_names)
6464
join_cols_set = set(join_cols)
65-
6665
non_key_cols = list(all_columns - join_cols_set)
6766

67+
if has_duplicate_rows(target_table, join_cols):
68+
raise ValueError("Target table has duplicate rows, aborting upsert")
69+
6870
if len(target_table) == 0:
6971
# When the target table is empty, there is nothing to update :)
7072
return source_table.schema.empty_table()

0 commit comments

Comments
 (0)