danny0405 commented on code in PR #10857:
URL: https://github.com/apache/hudi/pull/10857#discussion_r1535010094


##########
hudi-common/src/main/java/org/apache/hudi/common/model/FirstValueAvroPayload.java:
##########
@@ -27,6 +27,52 @@
 
 import java.util.Properties;
 
+/**
+ * Payload clazz that is used for Hudi Table.
+ *
+ * <p>Simplified FirstValueAvroPayload Logic:
+ * <pre>
+ *
+ *  Illustration with simple data.
+ *  the order field is 'ts', recordkey is 'id' and schema is :
+ *  {
+ *    [
+ *      {"name":"id","type":"string"},
+ *      {"name":"ts","type":"long"},
+ *      {"name":"name","type":"string"},
+ *      {"name":"price","type":"string"}
+ *    ]
+ *  }
+ *
+ *  case 1
+ *  Current data:
+ *      id      ts      name    price
+ *      1       1       name_1  price_1
+ *  Insert data:
+ *      id      ts      name    price
+ *      1       1       name_2    price_2
+ *
+ *  Result data after #preCombine or #combineAndGetUpdateValue:
+ *      id      ts      name    price
+ *      1       1       name_1  price_1
+ *
+ *  If precombine is the same, would keep the first one record
+ *
+ *  case 2
+ *  Current data:
+ *      id      ts      name    price
+ *      1       1       name_1  price_1
+ *  Insert data:
+ *      id      ts      name    price
+ *      1       2       name_2    price_2
+ *
+ *  Result data after preCombine or combineAndGetUpdateValue:
+ *      id      ts      name    price
+ *      1       2       name_2  price_2
+ *
+ *  Other condition it keep the same with DefaultHoodieRecordPayload which 
would save the record with the larger precombine value

Review Comment:
   The other functionalities are inherited from DefaultHoodieRecordPayload.



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