This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new ecdb0566d8d Storage Engine: Fixed inaccurate compression ratio when 
writing duplicate data (#12297)
ecdb0566d8d is described below

commit ecdb0566d8db67e5ebed1a96bcd21fa8a264b57a
Author: Zhijia Cao <[email protected]>
AuthorDate: Wed Apr 10 15:45:14 2024 +0800

    Storage Engine: Fixed inaccurate compression ratio when writing duplicate 
data (#12297)
---
 .../storageengine/dataregion/memtable/AlignedWritableMemChunk.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java
index 64a56ee3ac5..489520b201c 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AlignedWritableMemChunk.java
@@ -388,12 +388,13 @@ public class AlignedWritableMemChunk implements 
IWritableMemChunk {
                   list.getValueIndex(sortedRowIndex);
             }
             if (timeDuplicateInfo[sortedRowIndex]) {
-              if (!list.isNullValue(sortedRowIndex, columnIndex)) {
+              if (!list.isNullValue(list.getValueIndex(sortedRowIndex), 
columnIndex)) {
                 long recordSize =
                     MemUtils.getRecordSize(
                         tsDataType,
                         tsDataType == TSDataType.TEXT
-                            ? list.getBinaryByValueIndex(sortedRowIndex, 
columnIndex)
+                            ? list.getBinaryByValueIndex(
+                                list.getValueIndex(sortedRowIndex), 
columnIndex)
                             : null,
                         true);
                 CompressionRatio.decreaseDuplicatedMemorySize(recordSize);

Reply via email to