This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/dev/1.3 by this push:
new 78dfd29f6dd Fix division by zero error when flush memtable (#15183)
78dfd29f6dd is described below
commit 78dfd29f6dd0492ed956533195c80a2a1f5be2fa
Author: Haonan <[email protected]>
AuthorDate: Tue Mar 25 15:22:08 2025 +0800
Fix division by zero error when flush memtable (#15183)
---
.../org/apache/iotdb/db/utils/datastructure/AlignedTVList.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java
index 0b9f4d951b0..f379f236290 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/AlignedTVList.java
@@ -1288,8 +1288,11 @@ public abstract class AlignedTVList extends TVList {
if (largestBinaryChunkSize == 0) {
return largestPrimitivePointSize;
}
- int avgPointSizeOfLargestBinaryColumn =
- (int) largestBinaryChunkSize /
getColumnValueCnt(largestBinaryColumnIndex);
+ int columnValueCnt = getColumnValueCnt(largestBinaryColumnIndex);
+ if (columnValueCnt == 0) {
+ return largestPrimitivePointSize;
+ }
+ int avgPointSizeOfLargestBinaryColumn = (int) largestBinaryChunkSize /
columnValueCnt;
return Math.max(avgPointSizeOfLargestBinaryColumn,
largestPrimitivePointSize);
}