voonhous commented on code in PR #14340:
URL: https://github.com/apache/hudi/pull/14340#discussion_r2591688823


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/BufferedRecord.java:
##########
@@ -90,7 +91,11 @@ public HoodieOperation getHoodieOperation() {
 
   public BufferedRecord<T> toBinary(RecordContext<T> recordContext) {
     if (record != null) {
-      record = 
recordContext.seal(recordContext.toBinaryRow(recordContext.getSchemaFromBufferRecord(this),
 record));
+      HoodieSchema schema = recordContext.getSchemaFromBufferRecord(this);
+      // Schema can be null in test scenarios where schemas are not registered 
in the RecordContext (e.g. in tests)
+      if (schema != null) {
+        record = recordContext.seal(recordContext.toBinaryRow(schema, record));

Review Comment:
   This is in the original code. AM just adding an additional check to ensure 
that schema is not null. 
   
   `org.apache.hudi.common.engine.RecordContext#getSchemaFromBufferRecord` calls
   `org.apache.hudi.common.engine.RecordContext#decodeAvroSchema`, which is a 
nullable method.



-- 
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]

Reply via email to