You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "alexeykudinkin (via GitHub)" <gi...@apache.org> on 2023/02/16 19:56:42 UTC

[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #7942: [HUDI-5753] Add docs for record payload

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


##########
website/docs/record_payload.md:
##########
@@ -0,0 +1,97 @@
+---
+title: Record Payload 
+keywords: [hudi, merge, upsert, precombine]
+---
+
+## Record Payload
+
+One of the core features of Hudi is the ability to incrementally upsert data, deduplicate and merge records on the fly.
+Additionally, users can implement their custom logic to merge the input records with the record on storage. Record
+payload is an abstract representation of a Hudi record that allows the aforementioned capability. As we shall see below,
+Hudi provides out-of-box support for different payloads for different use cases, and a new record merger API for
+optimized payload handling. But, first let us understand how record payload is used in the Hudi upsert path.
+
+<figure>
+    <img className="docimage" src={require("/assets/images/upsert_path.png").default} alt="upsert_path.png" />
+</figure>
+
+Figure above shows the main stages that records go through while being written to the Hudi table. In the precombining
+stage, Hudi performs any deduplication based on the payload implementation and precombine key configured by the user.
+Further, on index lookup, Hudi identifies which records are being updated and the record payload implementation tells
+Hudi how to merge the incoming record with the existing record on storage.
+
+### Existing Payloads
+
+#### OverwriteWithLatestAvroPayload
+
+This is the default record payload implementation. It picks the record with the greatest value (determined by calling
+.compareTo() on the value of precombine key) to break ties and simply picks the latest record while merging. This gives
+latest-write-wins style semantics.
+
+#### EventTimeAvroPayload
+
+Some use cases require merging records by event time and thus event time plays the role of an ordering field. This
+payload is particularly useful in the case of late-arriving data. For such use cases, users need to set
+the [payload event time field](/docs/configurations#RECORD_PAYLOAD) configuration.
+
+#### ExpressionPayload
+
+This payload is very useful when you want to merge or delete records based on some conditional expression, especially

Review Comment:
   Correct this is only supposed to be used internally (by MERGE INTO)



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org