Skip to content

Commit 8a2b7f6

Browse files
committed
fix
1 parent bb0d4dc commit 8a2b7f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

paimon-python/pypaimon/write/table_upsert_by_key.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,20 @@ def _upsert_partition(
169169
for i, key_tuple in enumerate(input_key_tuples):
170170
key_to_last_idx[key_tuple] = i # last write wins
171171

172-
input_key_set = set(input_key_tuples)
173-
if len(input_key_tuples) != len(input_key_set):
172+
if len(input_key_tuples) != len(key_to_last_idx):
174173
original_count = len(input_key_tuples)
175174
dedup_indices = sorted(key_to_last_idx.values())
176175
partition_data = partition_data.take(dedup_indices)
177176
input_key_tuples = [input_key_tuples[i] for i in dedup_indices]
178-
logger.info(
177+
logger.warning(
179178
"Deduplicated input from %d to %d rows in partition %s "
180179
"(kept last occurrence).",
181180
original_count, len(input_key_tuples), partition_spec,
182181
)
183182

184183
# 3. Scan partition in batches, build key → _ROW_ID only for
185184
# keys present in the input (avoids full-partition materialisation).
185+
input_key_set = set(key_to_last_idx.keys())
186186
key_to_row_id = self._build_key_to_row_id_map(
187187
match_keys, partition_spec, input_key_set
188188
)

0 commit comments

Comments
 (0)