【问题标题】:update not working during batch insert in TDengine database在 TDengine 数据库中批量插入期间更新不起作用
【发布时间】:2021-09-28 03:47:48
【问题描述】:

我创建了一个 update=1 的数据库,这样我就可以根据时间戳更新一些记录。但是当我使用批量插入时,我发现更新不起作用。我也尝试了正常插入,更新记录正在工作。

Welcome to the TDengine shell from Linux, Client Version:2.1.7.2
Copyright (c) 2020 by TAOS Data, Inc. All rights reserved.

taos> create database test update 1;
Query OK, 0 of 0 row(s) in database (0.007977s)

taos> use test;
Database changed.

taos> create table tb(ts timestamp, c1 int);
Query OK, 0 of 0 row(s) in database (0.015282s)

taos> insert into tb values(now, 1)(now, null);
Query OK, 1 of 1 row(s) in database (0.000797s)

taos> select * from tb;
           ts            |     c1      |
========================================
 2021-09-28 11:37:32.339 |           1 |
Query OK, 1 row(s) in set (0.002671s)

taos> insert into tb values("2021-09-28 11:37:32.339", null);
Query OK, 1 of 1 row(s) in database (0.000611s)

taos> select * from tb;
           ts            |     c1      |
========================================
 2021-09-28 11:37:32.339 |        NULL |
Query OK, 1 row(s) in set (0.002591s)

TDengine中批量插入和普通插入有什么区别?

【问题讨论】:

    标签: tdengine


    【解决方案1】:

    批量插入使用相同的“现在”。它导致两条记录使用相同的时间戳,这不可能是有效的记录,因为时间序列数据库需要每条记录使用不同的时间戳。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-12-31
      • 1970-01-01
      • 1970-01-01
      • 2016-09-24
      • 2014-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多