danny0405 commented on code in PR #13225:
URL: https://github.com/apache/hudi/pull/13225#discussion_r2061251430
##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/client/model/HoodieFlinkRecord.java:
##########
@@ -170,11 +166,11 @@ public HoodieRecord prependMetaFields(Schema
recordSchema, Schema targetSchema,
@Override
public HoodieRecord updateMetaField(Schema recordSchema, int ordinal, String
value) {
-
ValidationUtils.checkArgument(recordSchema.getField(RECORD_KEY_METADATA_FIELD)
!= null,
- "The record is expected to contain metadata fields.");
- GenericRowData rowData = (GenericRowData) getData();
- rowData.setField(ordinal, StringData.fromString(value));
- return this;
+ String[] metaVals = new String[HoodieRecord.HOODIE_META_COLUMNS.size()];
+ metaVals[ordinal] = value;
+ boolean withOperation = recordSchema.getField(OPERATION_METADATA_FIELD) !=
null;
+ RowData rowData = new HoodieRowDataWithPartialMetaFields(metaVals,
Collections.singleton(ordinal), getData(), withOperation);
Review Comment:
not sure why only the partial meta fields are updated, during compaction,
all the meta fields should be kept and persisted to file.
--
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]