QuakeWang commented on code in PR #602:
URL: https://github.com/apache/paimon-rust/pull/602#discussion_r3646781219
##########
crates/paimon/src/table/table_write.rs:
##########
@@ -451,6 +456,107 @@ impl TableWrite {
Ok(())
}
+ fn validate_write_batch_schema(&self, batch: &RecordBatch) -> Result<()> {
+ let expected_schema = &self.write_schema;
+ let actual_schema = batch.schema();
+ let table_field_count = expected_schema.fields().len();
+ let actual_field_count = actual_schema.fields().len();
+ // Cross-partition routing generates its own `_VALUE_KIND` column so
that
+ // migrated rows can be written as deletes in their previous partition.
+ // Accepting a caller-provided column here would make the generated
delete
+ // batch contain `_VALUE_KIND` twice.
+ let allows_value_kind = self.changelog_producer ==
ChangelogProducer::Input
Review Comment:
This condition conflates input row kinds with changelog-file production.
`_VALUE_KIND` is consumed by the data writer even when
`changelog-producer=none`, while `ChangelogProducer::Input` only controls
writing separate changelog files. As a result, primary-key tables using the
default producer now reject valid DELETE/UPDATE batches before they reach the
writer.
--
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]