yihua commented on code in PR #14038:
URL: https://github.com/apache/hudi/pull/14038#discussion_r2399916417
##########
hudi-common/src/main/java/org/apache/hudi/common/model/SerializableIndexedRecord.java:
##########
@@ -68,6 +68,9 @@ private SerializableIndexedRecord(Schema schema, byte[]
bytes) {
}
public static SerializableIndexedRecord fromAvroBytes(Schema schema, byte[]
bytes) {
+ if (bytes.length == 0) {
+ return null;
Review Comment:
Would this cause NPE in `BaseAvroPayload#getRecord` when doing
`Option.of(record)`?
```
protected Option<IndexedRecord> getRecord(Schema schema) throws IOException {
if (record != null) {
if (record.getSchema() == schema) {
return Option.of(record);
}
// if the schema does not match, we need to deserialize with the
proper schema to match legacy behavior
recordBytes = getRecordBytes();
}
if (recordBytes == null || recordBytes.length == 0) {
return Option.empty();
}
record = SerializableIndexedRecord.fromAvroBytes(schema, recordBytes);
return Option.of(record);
}
```
--
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]