wwj6591812 commented on code in PR #8219:
URL: https://github.com/apache/paimon/pull/8219#discussion_r3457788787
##########
paimon-core/src/main/java/org/apache/paimon/append/ExternalStorageBlobWriter.java:
##########
@@ -125,20 +121,19 @@ public InternalRow transformRow(InternalRow row) throws
IOException {
return row;
}
- // clear all override positions so non-overridden fields fall back to
delegate
- for (ExternalStorageBlobFieldWriter fw : fieldWriters) {
- overrideRow.setField(fw.fieldIndex(), null);
- }
+ GenericRow result = (GenericRow) copyInternalRow(row, writeSchema);
Review Comment:
@JingsongLi
Thanks for pointing this out — you're right that copyInternalRow() preserves
the concrete row type, so casting its result to GenericRow is unsafe for
BinaryRow / NestedRow inputs.
I've fixed this by introducing InternalRowUtils.copyToGenericRow(), which
always materializes the input into a mutable GenericRow before applying field
overrides. ExternalStorageBlobWriter.transformRow() now uses this helper
instead of casting copyInternalRow().
I also added testCopyToGenericRowFromBinaryRow to cover the
InternalRowSerializer.toBinaryRow(...) path and verify the result remains
mutable via setField().
Please take another look when you have a chance. Thanks again!
--
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]