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/07/05 18:25:16 UTC

[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #5627: [HUDI-3350][HUDI-3351] Support HoodieMerge API and Spark engine-specific HoodieRecord

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


##########
hudi-common/src/main/java/org/apache/hudi/common/model/HoodieMerge.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hudi.common.model;
+
+import org.apache.avro.Schema;
+import org.apache.hudi.common.util.Option;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Properties;
+
+/**
+ * HoodieMerge defines how to merge two records. It is a stateless component.
+ * It can implement the merging logic of HoodieRecord of different engines
+ * and avoid the performance consumption caused by the serialization/deserialization of Avro payload.
+ */
+public interface HoodieMerge extends Serializable {
+  
+  HoodieRecord preCombine(HoodieRecord older, HoodieRecord newer);

Review Comment:
   @wulei0302 i think we need to make sure that we wrap up RFC-46 with the following artifacts on hands:
   
    - New APIs (forward-looking, one unified merging API)
    - Legacy APIs (backward-compatible, with `preCombine` and `combineAndGetUpdateValue`, necessary to facilitate the migration onto the new API)
   
   That way, we can encourage folks to migrate from existing model where Legacy API will be providing compatibility out-of-the box onto a new API which we can call a standard and deprecate a legacy one in 0.13



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