junmuz commented on code in PR #10702:
URL: https://github.com/apache/paimon/pull/10702#discussion_r4348401402
##########
paimon-core/src/main/java/org/apache/paimon/mergetree/compact/MergeTreeCompactManagerFactory.java:
##########
@@ -364,11 +364,36 @@ private MergeTreeCompactRewriter createRewriter(
} else {
processorFactory =
PersistValueProcessor.factory(valueType);
}
+ List<String> preserveColumns =
options.changelogPreserveFieldOnRetract();
+ int[] preserveFieldIndices = null;
+ if (!preserveColumns.isEmpty()) {
+ List<String> fieldNames = valueType.getFieldNames();
+ preserveFieldIndices =
+ preserveColumns.stream()
+ .mapToInt(
+ name -> {
+ int idx =
fieldNames.indexOf(name);
Review Comment:
Added rename handling for changelog-producer.preserve-field-on-retract,
following the existing behavior of sequence.field. Renaming a preserved column
now updates its reference in the option.
Added persisted-table tests that write initial rows, rename the referenced
columns, reopen the table, and commit an update and a delete. They verify the
rewritten options, current table contents, and persisted -U/-D records for both
single-field and multiple-field preservation. Also added coverage confirming
that dropping a column referenced by either option is rejected without changing
the stored schema. The column can be dropped after removing its references from
the relevant options. The rename and DROP behavior is now documented.
--
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]