You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/05/24 08:07:07 UTC

[GitHub] [hudi] xushiyan commented on a diff in pull request #4676: [HUDI-3304] support partial update on mor table

xushiyan commented on code in PR #4676:
URL: https://github.com/apache/hudi/pull/4676#discussion_r880190065


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecordPayload.java:
##########
@@ -58,6 +58,20 @@ default T preCombine(T oldValue, Properties properties) {
     return preCombine(oldValue);
   }
 
+  /**
+   * When more than one HoodieRecord have the same HoodieKey in the incoming batch, this function combines them before attempting to insert/upsert by taking in a schema.
+   * Implementation can leverage the schema to decide their business logic to do preCombine.
+   *
+   * @param oldValue   instance of the old {@link HoodieRecordPayload} to be combined with.
+   * @param schema Payload related schema. For example use schema to overwrite old instance for specified fields that doesn't equal to default value.
+   *
+   * @return the combined value
+   */
+  @PublicAPIMethod(maturity = ApiMaturityLevel.STABLE)
+  default T preCombine(T oldValue, Schema schema){

Review Comment:
   Why can't we use `default T preCombine(T oldValue, Properties properties)` and pass schema from there? This API is not generic enough to be placed at this level.



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