This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
The following commit(s) were added to refs/heads/master by this push:
new ee41b565a [core] Document object reusing in MergeFunction
ee41b565a is described below
commit ee41b565a38052182475e09d923a051a6a560beb
Author: Jingsong <[email protected]>
AuthorDate: Thu Jul 13 10:32:30 2023 +0800
[core] Document object reusing in MergeFunction
---
.../java/org/apache/paimon/mergetree/compact/MergeFunction.java | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/MergeFunction.java
b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/MergeFunction.java
index a5aa32851..1e8c7be8b 100644
---
a/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/MergeFunction.java
+++
b/paimon-core/src/main/java/org/apache/paimon/mergetree/compact/MergeFunction.java
@@ -25,6 +25,15 @@ import javax.annotation.Nullable;
/**
* Merge function to merge multiple {@link KeyValue}s.
*
+ * <p>IMPORTANT, Object reusing inside the kv of the {@link #add} input:
+ *
+ * <ul>
+ * <li>Please don't save KeyValue and InternalRow references to the List:
the KeyValue of the
+ * first two articles and the InternalRow object inside them are safe,
but the reference of
+ * the third article may overwrite the reference of the first article.
+ * <li>You can save fields references: fields don't reuse their objects.
+ * </ul>
+ *
* @param <T> result type
*/
public interface MergeFunction<T> {