apache / apache/iotdb

[Bug] 使用insertTablets插入,当MeasurementSchema 的TSDataType 是TSDataType.TEXT 时,不支持空值插入,指定了bitmap也不行

未关闭
#9,721 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
6.4k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
115

描述

### Search before asking

- [ ] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

1.1.0

### Describe the bug and provide the minimal reproduce step

1、构建Table schemas ,指定TSDataType 类型是TSDataType.TEXT
2、构造模拟数据插入空值
```java
if (containNull && i % 9 == 0) {
tablet.bitMaps[i].mark((int) row);
}else{
tablet.addValue(schemaList.get(i).getMeasurementId(),row,random.nextDouble()*1000+"");
}
```
3、插入 sessionPool.insertTablets(tabletMap, false); 报错
Exception in thread "main" java.lang.NullPointerException
at org.apache.iotdb.tsfile.write.record.Tablet.calOccupationOfOneColumn(Tablet.java:341)

### What did you expect to see?

希望正常入库

### What did you see instead?

Exception in thread "main" java.lang.NullPointerException
at org.apache.iotdb.tsfile.write.record.Tablet.calOccupationOfOneColumn(Tablet.java:341)
source code: Tablet l ine:252
for(int rowIndex = 0; rowIndex < this.rowSize; ++rowIndex) {
valueOccupation += ### binaries[rowIndex].getLength();
}

### Anything else?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

贡献指南

打开贡献指南

调研方向

从 Tablet.java 第 341 行附近的 Tablet.calOccupationOfOneColumn 开始,然后使用 TEXT MeasurementSchema、在 bitmap 中标记为 null 的值以及 sessionPool.insertTablets 重现该问题。跟踪对 binaries[rowIndex].getLength(); 的访问;当 tablet 成功插入且 null TEXT 值不会导致 NullPointerException 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
databases
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。