yuxiqian commented on code in PR #4374:
URL: https://github.com/apache/flink-cdc/pull/4374#discussion_r3063542070
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/serializer/data/writer/BinaryWriter.java:
##########
@@ -171,7 +176,19 @@ static void write(
writer.writeMap(pos, (MapData) o, (MapDataSerializer)
serializer);
break;
case ROW:
- writer.writeRecord(pos, (RecordData) o,
(TypeSerializer<RecordData>) serializer);
+ RecordData recordData = (RecordData) o;
+ if (!(recordData instanceof BinaryRecordData)) {
+ RowType rowType = (RowType) type;
+ List<DataType> childTypes = rowType.getChildren();
+ Object[] fields = new Object[recordData.getArity()];
+ for (int i = 0; i < fields.length; i++) {
+ fields[i] =
+
RecordData.createFieldGetter(childTypes.get(i), i)
+ .getFieldOrNull(recordData);
+ }
+ recordData = new
BinaryRecordDataGenerator(rowType).generate(fields);
+ }
Review Comment:
That shouldn't differ. Added assertions to ensure that claim.
--
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]