yihua commented on code in PR #12122:
URL: https://github.com/apache/hudi/pull/12122#discussion_r1819641384
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java:
##########
@@ -427,6 +428,24 @@ public HoodieRecord rewriteRecordWithNewSchema(Schema
recordSchema, Properties p
public abstract Option<Map<String, String>> getMetadata();
+ private void initMetadata() {
+ this.metaData = Option.of(new HashMap<>());
Review Comment:
Could we make `this.metaData` final and get rid of this?
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java:
##########
@@ -427,6 +428,24 @@ public HoodieRecord rewriteRecordWithNewSchema(Schema
recordSchema, Properties p
public abstract Option<Map<String, String>> getMetadata();
+ private void initMetadata() {
+ this.metaData = Option.of(new HashMap<>());
Review Comment:
`this.metaData` is not included in the serialization and deserialization so
the information can be lost.
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java:
##########
@@ -427,6 +428,24 @@ public HoodieRecord rewriteRecordWithNewSchema(Schema
recordSchema, Properties p
public abstract Option<Map<String, String>> getMetadata();
+ private void initMetadata() {
+ this.metaData = Option.of(new HashMap<>());
+ }
+
+ public void addMetadata(String key, String value) {
+ if (metaData == null || metaData.isEmpty()) {
+ initMetadata();
+ }
Review Comment:
Get rid of this?
--
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]