This is an automated email from the ASF dual-hosted git repository. forwardxu pushed a commit to branch release-0.12.1 in repository https://gitbox.apache.org/repos/asf/hudi.git
commit bf171d5eb85a63260bf1ac9c7777065ad0562005 Author: XuQianJin-Stars <[email protected]> AuthorDate: Mon Dec 12 19:20:20 2022 +0800 fix metatable writing multiple records with same key --- .../apache/hudi/common/table/log/block/HoodieHFileDataBlock.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java b/hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java index d923c592708..e60da7d0144 100644 --- a/hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java +++ b/hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java @@ -36,12 +36,12 @@ import org.apache.hudi.common.fs.inline.InLineFileSystem; import org.apache.hudi.common.util.ClosableIterator; import org.apache.hudi.common.util.Option; import org.apache.hudi.common.util.StringUtils; -import org.apache.hudi.common.util.ValidationUtils; import org.apache.hudi.exception.HoodieIOException; import org.apache.hudi.io.storage.HoodieHBaseKVComparator; import org.apache.hudi.io.storage.HoodieHFileReader; import org.apache.log4j.LogManager; import org.apache.log4j.Logger; +import org.mortbay.log.Log; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -130,8 +130,9 @@ public class HoodieHFileDataBlock extends HoodieDataBlock { } final byte[] recordBytes = serializeRecord(record); - ValidationUtils.checkState(!sortedRecordsMap.containsKey(recordKey), - "Writing multiple records with same key not supported for " + this.getClass().getName()); + if (sortedRecordsMap.containsKey(recordKey)) { + Log.warn("Writing multiple records with same key not supported for " + this.getClass().getName()); + } sortedRecordsMap.put(recordKey, recordBytes); }
