JingsongLi commented on code in PR #11048:
URL: https://github.com/apache/paimon/pull/11048#discussion_r4519853673
##########
paimon-python/pypaimon/execution/python/write/commit/row_id_conflict.py:
##########
@@ -35,10 +35,9 @@ def check_row_id_conflicts(table, messages,
latest_snapshot_id, check_from_snaps
baseline = manager.get_snapshot_by_id(check_from_snapshot)
if latest is None or baseline is None:
raise ValueError('Row-ID conflict check snapshots must exist in the
current table')
- current_schema = table.schema_manager.latest()
- if (baseline.schema_id != latest.schema_id
- or current_schema is not None and current_schema.id !=
table.table_schema.id):
- raise ValueError('Row-ID conflict checks require an unchanged, current
table schema')
+ # Logical conflicts compare field IDs resolved in each file's historical
+ # schema, just like ordinary commits. Different schema versions alone do
Review Comment:
I reproduced this with real staged files and commits on the exact base
(`4b8e50df`) and PR head (`22d13bea`). I staged `age = 99` for an existing row,
appended a row without changing the staged file's row-ID range, then dropped
and re-added `age` under the same name. The append came before the DDL, so both
snapshots initially referenced the old schema.
- **Ray self-merge commit path:** The base rejects the commit with `Row-ID
conflict checks require an unchanged, current table schema`. The PR head
commits successfully, but reading the target row under the recreated `age`
field returns `NULL`.
- **`update_by_row_id` commit path:** The base's direct commit already
succeeds without applying the update to the recreated field. The PR head still
does so.
The old schema guard ran in the self-merge coordinator, so that path is
where this PR introduces the regression. Please validate the historical field
IDs of every staged update file against the schema used for commit, including
files that do not need rewriting. This also needs to cover DDL that leaves the
data snapshot ID unchanged.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]