cshuo commented on code in PR #13498:
URL: https://github.com/apache/hudi/pull/13498#discussion_r2191381882
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/FlinkRowDataReaderContext.java:
##########
@@ -195,6 +196,22 @@ public HoodieRecord<RowData>
constructHoodieRecord(BufferedRecord<RowData> buffe
return new HoodieFlinkRecord(hoodieKey, operation,
bufferedRecord.getOrderingValue(), rowData);
}
+ @Override
+ public RowData constructEngineRecord(Schema schema,
+ Map<Integer, Object> updateValues,
+ BufferedRecord<RowData> baseRecord) {
+ GenericRowData genericRowData = new
GenericRowData(schema.getFields().size());
+ for (Schema.Field field : schema.getFields()) {
+ int pos = field.pos();
+ if (updateValues.containsKey(pos)) {
+ genericRowData.setField(pos, updateValues.get(pos));
+ } else {
+ genericRowData.setField(pos, getValue(baseRecord.getRecord(), schema,
field.name()));
+ }
+ }
+ return toBinaryRow(schema, genericRowData);
Review Comment:
yes, there is no need to call `toBinaryRow` here, since `toBinaryRow` will
be called right before buffered records being put into the record buffer.
https://github.com/apache/hudi/blob/f80fc25fe906686694557b5d8d2f68f9b5c9215e/hudi-common/src/main/java/org/apache/hudi/common/table/read/KeyBasedFileGroupRecordBuffer.java#L96
--
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]