[Bug] 2.0.5版本,table模式下,无模式建的表,再执行insert时,会把已经存在的记录里除了timestamp之外的字段全部覆盖

オープン
#16,630 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java, sql
領域
databases

調査の方向性

提供されている testCreateAndInsert の再現から始め、TableSessionBuilder と 2.0.5 docker-standalone セットアップに対する table-mode insert パスを使用します。schemaless tablet insert と、その後の db1.table1 への SQL INSERT を比較します。上書きを再現し、既存のレコードが以前のタイムスタンプ以外の値を保持していることを確認できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Search before asking
  • I searched in the issues and found nothing similar.
Version

release2.0.5
docker-standalone

Describe the bug and provide the minimal reproduce step

1、安装2.0.5 docker-standalone版本
2、建表并插入数据
@Test
public void testCreateAndInsert() throws Exception {
log.info("IOTDB Test executed");
try (ITableSession session =
new TableSessionBuilder()
.nodeUrls(Collections.singletonList("127.0.0.1:6667"))
.username("root")
.password("root")
.build()) {

        session.executeNonQueryStatement("CREATE DATABASE IF NOT EXISTS db1");
        session.executeNonQueryStatement("use db1");

        // 不创建表直接写入数据
        List<String> columnNameList =
                Arrays.asList("region_id", "plant_id", "device_id", "model","kind","weather","birthday", "temperature", "humidity");
        List<TSDataType> dataTypeList =
                Arrays.asList(
                        TSDataType.STRING,
                        TSDataType.STRING,
                        TSDataType.STRING,
                        TSDataType.STRING,
                        TSDataType.STRING,
                        TSDataType.STRING,
                        TSDataType.STRING,
                        TSDataType.FLOAT,
                        TSDataType.DOUBLE);
        List<ColumnCategory> columnTypeList =
                new ArrayList<>(
                        Arrays.asList(
                                ColumnCategory.TAG,
                                ColumnCategory.TAG,
                                ColumnCategory.TAG,
                                ColumnCategory.ATTRIBUTE,
                                ColumnCategory.ATTRIBUTE,
                                ColumnCategory.ATTRIBUTE,
                                ColumnCategory.ATTRIBUTE,
                                ColumnCategory.FIELD,
                                ColumnCategory.FIELD));
        Tablet tablet = new Tablet("table1", columnNameList, dataTypeList, columnTypeList, 100);
        for (int i = 0; i < 100; i++) {
            int rowIndex = tablet.getRowSize();
            tablet.addTimestamp(rowIndex, System.currentTimeMillis());
            tablet.addValue("region_id", rowIndex, "1");
            tablet.addValue("plant_id", rowIndex, "5");
            tablet.addValue("device_id", rowIndex, "3");
            tablet.addValue("model", rowIndex, "A");
            tablet.addValue("kind", rowIndex, "west");
            tablet.addValue("weather", rowIndex, "cloudy");
            tablet.addValue("birthday", rowIndex, "2025-10-17");
            tablet.addValue("temperature", rowIndex, 37.6F);
            tablet.addValue("humidity", rowIndex, 111.1);
            if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
                session.insert(tablet);
                tablet.reset();
            }
            log.info("数据" + i);
            Thread.sleep(3000L);
        }
        if (tablet.getRowSize() != 0) {
            session.insert(tablet);
            tablet.reset();
        }
    }
    log.info("数据插入成功");
}

3、观察数据插入成功
4、再通过命令插入记录
INSERT INTO db1.table1 (region_id, plant_id, device_id, model, kind, weather, birthday, temperature, humidity)
VALUES ('1', '5', '3', 'B', 'north', 'rain', '2025-10-19', 40.6, 121.1)
5、观察发现已经存在的记录里除了timestamp之外的字段全部覆盖了

What did you expect to see?

2.0.5版本,table模式下,无模式建的表,再执行insert时,会把已经存在的记录里除了timestamp之外的字段全部覆盖。

What did you see instead?

nothing

Anything else?

No response

Are you willing to submit a PR?
  • I'm willing to submit a PR!
主要言語
Java
スター
6.4k
フォーク
1.2k
平均マージ
1日 12時間
マージ済み PR(30日)
284

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iotdb のほかの issue

apache/iotdb の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。