diff --git a/paimon-common/src/main/java/org/apache/paimon/utils/BloomFilter64.java b/paimon-common/src/main/java/org/apache/paimon/utils/BloomFilter64.java index 8554c9d03ab5e..5a4be5a45f050 100644 --- a/paimon-common/src/main/java/org/apache/paimon/utils/BloomFilter64.java +++ b/paimon-common/src/main/java/org/apache/paimon/utils/BloomFilter64.java @@ -108,8 +108,8 @@ public int bitSize() { } public void toByteArray(byte[] bytes, int offset, int length) { - for (int i = 0; i < length; i++) { - bytes[offset + i] = data[this.offset + i]; + if (length >= 0) { + System.arraycopy(data, this.offset, bytes, offset, length); } } }