This is an automated email from the ASF dual-hosted git repository. shuwenwei pushed a commit to branch fixEstimatedSizeForStringType-1.3 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 5e1b87b1c136f9b406eb977b01285355f2dc288c Author: shuwenwei <[email protected]> AuthorDate: Mon Jul 28 18:20:12 2025 +0800 fix estimating memory cost for string type --- .../compaction/selector/estimator/CompactionEstimateUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/estimator/CompactionEstimateUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/estimator/CompactionEstimateUtils.java index 419d8a6ed7c..1027f49d654 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/estimator/CompactionEstimateUtils.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/estimator/CompactionEstimateUtils.java @@ -32,6 +32,7 @@ import org.apache.tsfile.file.metadata.ChunkMetadata; import org.apache.tsfile.file.metadata.IDeviceID; import org.apache.tsfile.file.metadata.MetadataIndexNode; import org.apache.tsfile.file.metadata.statistics.BinaryStatistics; +import org.apache.tsfile.file.metadata.statistics.StringStatistics; import org.apache.tsfile.read.TsFileDeviceIterator; import org.apache.tsfile.read.TsFileSequenceReader; import org.apache.tsfile.utils.Pair; @@ -112,6 +113,10 @@ public class CompactionEstimateUtils { currentSeriesRamSize += chunkMetadata.getStatistics().getRetainedSizeInBytes() - BinaryStatistics.INSTANCE_SIZE; + } else if (dataType == TSDataType.STRING) { + currentSeriesRamSize += + chunkMetadata.getStatistics().getRetainedSizeInBytes() + - StringStatistics.INSTANCE_SIZE; } else { break; }
