alexeykudinkin commented on code in PR #6977:
URL: https://github.com/apache/hudi/pull/6977#discussion_r998457397


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/commmon/model/HoodieSparkRecord.java:
##########
@@ -299,6 +319,42 @@ public Comparable<?> getOrderingValue(Schema recordSchema, 
Properties props) {
     }
   }
 
+  /**
+   * NOTE: This method is declared final to make sure there's no polymorphism 
and therefore
+   *       JIT compiler could perform more aggressive optimizations
+   */
+  @Override
+  protected final void writeRecordPayload(InternalRow payload, Kryo kryo, 
Output output) {
+    // NOTE: [[payload]] could be null if record has already been deflated
+    UnsafeRow unsafeRow = convertToUnsafeRow(payload, schema);

Review Comment:
   This is done to simplify ser/deserialization sequnce:
   
    - We always project to `UnsafeRow` before serialization, therefore
    - We need to decode just the `UnsafeRow` when we deserialize
    - Ser/de of `UnsafeRow` is as simple as just writing out the bytes



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