cshuo commented on code in PR #13078:
URL: https://github.com/apache/hudi/pull/13078#discussion_r2049858261
##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/client/model/HoodieFlinkRecord.java:
##########
@@ -112,15 +135,24 @@ public HoodieRecord joinWith(HoodieRecord other, Schema
targetSchema) {
@Override
public HoodieRecord prependMetaFields(Schema recordSchema, Schema
targetSchema, MetadataValues metadataValues, Properties props) {
- int metaFieldSize = targetSchema.getFields().size() -
recordSchema.getFields().size();
- GenericRowData metaRow = new GenericRowData(metaFieldSize);
+ boolean withMetaFields = recordSchema.getField(RECORD_KEY_METADATA_FIELD)
!= null;
+ boolean withOperationField =
targetSchema.getField(OPERATION_METADATA_FIELD) != null;
+ int metaFieldSize = HOODIE_META_COLUMNS.size();
+ String[] metaFields = new String[metaFieldSize];
+ if (withMetaFields) {
+ for (int i = 0; i < metaFieldSize; i++) {
+ metaFields[i] = data.getString(i).toString();
Review Comment:
For compaction, the record will be updated with new
`FILENAME_METADATA_FIELD` value, while others meta fields remain unchanged, so
here we get metadata fields from the data itself.
--
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]