boneanxs commented on code in PR #7362:
URL: https://github.com/apache/hudi/pull/7362#discussion_r1148835915
##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java:
##########
@@ -391,6 +392,11 @@ protected static boolean hasMetaFields(Schema schema) {
return schema.getField(HoodieRecord.RECORD_KEY_METADATA_FIELD) != null;
}
+ public long estimateSerializedSize() {
+ return ObjectSizeCalculator.getObjectSize(this);
Review Comment:
We can overwrite `HoodieAvroRecord` and `HoodieSparkRecord` to provide bytes
size directly.
```java
// HoodieSparkRecord
@Override
public long estimateSerializedDataSize() {
if (data instanceof UnsafeRow) {
return ((UnsafeRow) data).getSizeInBytes();
}
return super.estimateSerializedDataSize();
}
```
```java
// HoodieAvroRecord
@Override
public long estimateSerializedDataSize() {
if (data instanceof BaseAvroPayload) {
return ((BaseAvroPayload)data).recordBytes.length;
}
return super.estimateSerializedDataSize();
}
```
--
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]