JingsongLi commented on code in PR #8219:
URL: https://github.com/apache/paimon/pull/8219#discussion_r3457550766


##########
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:
   `copyInternalRow` is not guaranteed to return a `GenericRow`: for inputs 
such as `BinaryRow` (and `NestedRow`) it returns the same concrete row type 
copy. This writer accepts the generic `InternalRow` path, so an 
external-storage blob table write can reach here with a binary row (for 
example, `InternalRowSerializer.toBinaryRow(...)`) and then fails with 
`ClassCastException: BinaryRow cannot be cast to GenericRow` before writing. 
Please build a mutable `GenericRow` explicitly, or otherwise avoid assuming the 
copied row type before calling `setField`.



-- 
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]

Reply via email to